Get the complete command line as-is

TheFlyingDutchman zzbbaadd at aol.com
Wed Sep 12 01:19:23 EDT 2007


>
> python.exe test.py  "\"abc def\" 123"
>
> import sys
> commandLine = "".join(sys.argv[1:])
>
> print commandLine
>
> gives:
>
> "abc def" 123

With the surrounding quotes you actually only need:

commandLine = sys.argv[1]




More information about the Python-list mailing list