optparse commandline

2007-07-08 Thread vvikram
I want to call some function from my program and just pass it a commandline. It should parse the commandline and return back a list of parsed arguments (just like the sys.argv list) Example: foo.parse_cmdline("/usr/bin/foorun -v -d -h") ==> ['/usr/bin/foorun', '-v', '-d','-h'] Any suggestions on

socket.getfqdn deadlock

2007-03-20 Thread vvikram
Hi, I am getting deadlocks (backtrace pasted below) after a while at, presumably, a socket.getfqdn() call in a child process . Fwiw: This child process is created as the result of a pyro call to a Pyro object. Any ideas why this is happening? Thanks. Regards, Vikram --- Machine info: Linux ab

re.I slowness

2006-03-30 Thread vvikram
We process a lot of messages in a file based on some regex pattern(s) we have in a db. If I compile the regex using re.I, the processing time is substantially more than if I don't i.e using re.I is slow. However, more surprisingly, if we do something on the lines of : s = s = s.lower() t = dict(