Command line arguements
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Mon Jul 28 04:29:14 EDT 2008
En Mon, 28 Jul 2008 01:43:52 -0300, Henry Chang <goldspin at gmail.com> escribió:
> try optparse :)
> http://docs.python.org/lib/module-optparse.html
(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:
import sys
print sys.argv
with no arguments, one, and several, and see what happens.
--
Gabriel Genellina
More information about the Python-list
mailing list