command line arguments?

Erik Max Francis max at alcyone.com
Wed Aug 14 19:58:12 CEST 2002


brobbins333 at shaw.ca wrote:

> Is it possible to invoke a Python script with command line arguments
> in the manner of C?
> 
> Something like this (not in the interactive interpreter):
> 
> C:\> python myscript.py arg1 arg2

Sure.  See sys.argv.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ There is nothing so subject to the inconstancy of fortune as war.
\__/ Miguel de Cervantes
    Church / http://www.alcyone.com/pyos/church/
 A lambda calculus explorer in Python.



More information about the Python-list mailing list