command line arguments?

Fredrik Lundh fredrik at
Wed Aug 14 13:59:38 EDT 2002

brobbins333 at 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 arg1 arg2

the script name and the arguments end up in a list called
sys.argv.  in your case, the list would contain:

    ["", "arg1", "arg2"]

see section 2.1.1 in the tutorial:


More information about the Python-list mailing list