Re: Get the complete command line as-is

2007-09-13 Thread Tim Golden
Thomas Heller wrote: > Better would be this code: > > import ctypes > ctypes.windll.kernel32.GetCommandLineA.restype = ctypes.c_char_p > print ctypes.windll.kernel32.GetCommandLineA() Or you could use pywin32: import win32api print win32api.GetCommandLine () TJG -- http://mail.python.org/m

Re: Get the complete command line as-is

2007-09-13 Thread Thomas Heller
wangzq schrieb: > On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> wangzq a écrit : >> >> > 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(sy

Re: Get the complete command line as-is

2007-09-13 Thread Tim Golden
wangzq wrote: > On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> wangzq a écrit : >> >>> 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:]), the

Re: Get the complete command line as-is

2007-09-12 Thread wangzq
On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > wangzq a écrit : > > > 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

Re: Get the complete command line as-is

2007-09-12 Thread Larry Bates
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 l

Re: Get the complete command line as-is

2007-09-12 Thread Laurent Pointal
wangzq a écrit : > 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 comman

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
> > 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] -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
> > 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: >

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 8:33 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 11, 8:00 pm, wangzq <[EMAIL PROTECTED]> 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

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 8:00 pm, wangzq <[EMAIL PROTECTED]> 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

Re: Get the complete command line as-is

2007-09-11 Thread Steve Holden
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 l

Get the complete command line as-is

2007-09-11 Thread wangzq
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 brows