Command line arguements
gagsl-py2 at yahoo.com.ar
Mon Jul 28 10:29:14 CEST 2008
En Mon, 28 Jul 2008 01:43:52 -0300, Henry Chang <goldspin at gmail.com> escribió:
> try optparse :)
(optparse might be too much for a single argument)
> On Sun, Jul 27, 2008 at 9:13 PM, aditya shukla
> <adityashukla1983 at gmail.com>wrote:
>> in other words i do not want to do hard code the name of the file in my
>> code every time i need to read it.
>> I was reading about the sys module and i guess sys.argv would take the
>> input from the command line whenever i run the python script .
Exactly. Try this:
with no arguments, one, and several, and see what happens.
More information about the Python-list