[Python-Dev] PEP 389: argparse - new command line parsing module

skip at pobox.com skip at pobox.com
Tue Sep 29 13:48:36 CEST 2009


    Martin> alpha = None
    Martin> beta = False
    Martin> options, args = getopt.getopt(sys.argv[1:],"a:b",['alpha=','beta']):
    Martin> for opt, val in options:
    ...

    Martin> Even though this is many more lines, I prefer it over
    Martin> optparse/argparse: this code has only a single function call,
    ...

Agreed.  I have never completely wrapped my brain around optparse.  Getopt I
just remember.

Skip


More information about the Python-Dev mailing list