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
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
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
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
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
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
>
> 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
>
> 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:
>
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
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
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
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
12 matches
Mail list logo