EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread jkv
client will send 'qwerty\r\000' instead and then my application will hang at 'password = raw_input()' forever. Any suggestions? Regards, jkv -- http://mail.python.org/mailman/listinfo/python-list

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread jkv
Terry Reedy wrote: jkv wrote: Hi, Are there any way to change the EOL character for sys.stdin.readline() and raw_input()? My problem is that i cannot rely on that the clients connection to my application will end all lines with \n or \r\n. Sometimes they will use \r\000 as EOL. Example

Re: EOL for sys.stdin.readline() and raw_input()

2009-02-26 Thread jkv
really use twisted since i don't have raw network access - i only got stdout, stdin and stderr to play with. But i found a solution, posting it here for the archives: password = "" while 1: c = sys.stdin.read(1) if c == '\r' or c == '\n': break password = password + c Regards, jkv -- http://mail.python.org/mailman/listinfo/python-list

Re: Q: finding distance between 2 time's

2009-05-30 Thread jkv
x27;fil -> %s %d @ %s') % (x, nSize, time.asctime > (tstF)) > return 0 > > tstN = time.localtime() > print tstN > print "Time now: %s" % time.asctime(tstN) > buildList('C:\Martin\Work\Work_Eclipse\.metadata') > > > -- Regards, jkv http://unixcluster.dk/public.key -- http://mail.python.org/mailman/listinfo/python-list

Re: Q: finding distance between 2 time's

2009-05-30 Thread jkv
mar...@hvidberg.net wrote: > Thanks both > > The first answer is quite instuctive, the other one might be the one > I'll use in t I didn't receive the other answer, could you please forward it to me? > So 2x thanks. You are welcome. I took another look at your code, and you can compress it all to

Re: csv blank fields

2009-06-27 Thread jkv
sted, if not i appended to the row. Something like: try: row[11] except IndexError: row.append("") If you want to insert a value into empty cells you can do something like this: if row[10] == '' row[10] = 'NULL' -- Regards, jkv http://unixcluster.dk/public.key -- http://mail.python.org/mailman/listinfo/python-list