python -- figured out how to parse command line args

Skip Montanaro skip at pobox.com
Thu Jun 24 08:49:54 EDT 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.

Skip




More information about the Python-list mailing list