Library for handling GNU parameters

Peter Hansen peter at engcorp.com
Mon Feb 23 17:05:58 EST 2004


Florian Lindner wrote:
> 
> is there a python library available for handling GNU parameters. For
> example:
> 
> prog --filename=foo.bar   is the same as  prog -f foo.bar
> 
> or
> 
> prog --execute   ==  prog -e
> 
> I look for a library for parsing these string and represent the values in a
> list.

The standard library module getopt can do that, at least for the sort
of example you show, and I suspect the newer standard library module
optparse could also handle it (but haven't tried myself).

-Peter



More information about the Python-list mailing list