python -- figured out how to parse command line args

Skip Montanaro skip at
Thu Jun 24 14:49:54 CEST 2004

    David> I figured out how to do it in its simplest form...

    David> import sys
    David> for arg in sys.argv:
    David>     print "arg: ", arg

You might also want to take a look at the optparse and getopt modules for a
somehwat higher level take on parsing command line args.


More information about the Python-list mailing list