En Fri, 24 Apr 2009 06:40:23 -0300, Enchanter <ensoul.magaz...@gmail.com> escribió:

How to pass the raw command line arguments to the python?

That depends on the OS or the shell you're using.

Such as:

     mypython.py  txt -c "Test Only" {Help}


The arguments I hope to get is:

              txt -c "Test Only" {Help}               -- Keep the
quotation marks in the arguments.

I guess you're using Windows:

gg>type show.py
import sys
print sys.argv

gg>python show.py one txt -c """Test Only""" {Help}
['show.py', 'one', 'txt', '-c', '"Test Only"', '{Help}']

Two double quotes represent a single one. And you have to enclose the whole argument in quotes too because of the space character.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to