Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
[ANN] argparse 1.1 - Command-line parsing library
Steven Bethard
3/1/2010 8:31:00 AM
=======================
Announcing argparse 1.1
=======================
The argparse module provides an easy, declarative interface for
creating command line tools, which knows how to:
* parse the arguments and flags from sys.argv
* convert arg strings into objects for your program
* format and print informative help messages
* and much more...
The argparse module improves on the standard library optparse module
in a number of ways including:
* handling positional arguments
* supporting sub-commands
* allowing alternative option prefixes like + and /
* handling zero-or-more and one-or-more style arguments
* producing more informative usage messages
* providing a much simpler interface for custom types and actions
Download argparse
=================
The argparse homepage has links for source, MSI and single file
distributions of argparse:
http://code.google.com/p...
About this release
==================
This is the final release of argparse before its move to the Python
2.7 and 3.2 standard libraries. Major enhancements in this release:
* ArgumentParser(..., version=XXX) is deprecated. Instead, you should
use add_argument(..., action='version') which is more flexible and
does not force you to accept -v/--version as your version flags.
* Usage and help (but not version) messages are now written to stdout
instead of stderr, consistent with most existing programs.
* User defined types passed as a type= argument can now raise an
ArgumentTypeError to provide a custom error message.
* Namespace objects now support containment, e.g. "'foo' in args".
Various bugs were also squashed, e.g. "from argparse import *" now
works. See the news file for detailed information:
http://argparse.googlecode.com/svn/tags/r1...
Enjoy!
Steve
--
Where did you get that preposterous hypothesis?
Did Steve tell you that?
--- The Hiphopopotamus
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[ANN] argparse 1.1 - Command-line parsing library
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password