> > It seems that \" will retain the quote marks but then the spaces get > gobbled. > > But if you replace the spaces with another character: > > python.exe test.py \"abc#def\"#123 > > then: > > import sys > commandLine = "".join(sys.argv[1:]) > > prints commandLine.replace('#',' ') > > gives: > > "abc def" 123 > > Don't know if you can use that technique or not.
Came back for a second try and found out that: python.exe test.py "\"abc def\" 123" import sys commandLine = "".join(sys.argv[1:]) print commandLine gives: "abc def" 123 -- http://mail.python.org/mailman/listinfo/python-list