Get the complete command line as-is

Steve Holden steve at holdenweb.com
Wed Sep 12 05:16:30 CEST 2007


wangzq wrote:
> Hello,
> 
> 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.
> 
> Thanks.
> 
You can't. The quotes are gobbled  by the command-line processor before 
your program ever gets the chance to see them. You could try writing 
your own command shell ... or learn how to quote the quotes.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------




More information about the Python-list mailing list