arguments from the prompt

Fredrik Lundh effbot at telia.com
Sun Feb 6 17:57:29 EST 2000


joe at localhost.localdomain wrote:
> how do I write a python script to recive arguments from the
> command prompt?

you import the sys module, and read up on
sys.argv in the manual?

(hint: sys.argv contains a list of all command
line arguments passed to the program. argv[0]
is the name of the program itself).

if you want to parse options in a standard
fashion, you can use the getopt module.  see
the docs for details.

</F>





More information about the Python-list mailing list