Parsing command line options

Daniel Klein danielk at aracnet.com
Thu May 23 17:12:37 EDT 2002


I am converting a Java application to Python. The application has several
optional '-Dproperty=value' commandline options that can be specified in any
combination and in any sequence. Is there something equivalent in Python?

I took a look at the 'getopt' module but the Python commandline does not
allow you to use options other than those that are 'understandable' by the
interperator. The only way I can figure to implement this is to create my own
syntax and pass these as arguments to sys.argv.

Am I on the right track or am I derailed? ;-)

Daniel Klein



More information about the Python-list mailing list