One step up from str.split()

Joel Koltner zapwireDASHgroups at yahoo.com
Tue Jul 15 19:28:54 EDT 2008


"Sion Arrowsmith" <siona at chiark.greenend.org.uk> wrote in message 
news:Tiv*wYYhs at news.chiark.greenend.org.uk...
> What's wrong with sys.argv ?

Mainly that it doesn't exist.  :-)  The example was slightly contrived -- I'm 
really dealing with commands interactively entered within a program in 
response to raw_input(), although the format of the commands is meant to be 
consistent with command-line usage.  (A real command, for instance, would be 
something like this: load "my firmware file.bin" .)

I ended up using shlex.strip() -- works great!

---Joel





More information about the Python-list mailing list