Get the complete command line as-is

TheFlyingDutchman zzbbaadd at aol.com
Wed Sep 12 07:19:23 CEST 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