Get the complete command line as-is
larry.bates at websafe.com
Wed Sep 12 19:18:50 CEST 2007
> I'm passing command line parameters to my browser, I need to pass the
> complete command line as-is, for example:
> test.py "abc def" xyz
> If I use ' '.join(sys.argv[1:]), then the double quotes around "abc
> def" is gone, but I need to pass the complete command line ("abc def"
> xyz) to the browser, how can I do this?
> I'm on Windows.
Question: If you don't want to parse this as a command line, why don't you read
it as data via raw input or from some configuration file?
python program (pgm.py):
cmdline=raw_input("enter your parameters")
external file (cmd.txt):
"abc def" xyz
python pgm.py < cmd.txt
More information about the Python-list