A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-April/044617.html below:

[Python-Dev] Small additions to optparser

[Python-Dev] Small additions to optparser [Python-Dev] Small additions to optparserBarry Warsaw barry at python.org
Fri Apr 30 13:30:37 EDT 2004
On Fri, 2004-04-30 at 11:23, Dan Gass wrote:

> It would be nice to have a way for the white space to be cleaned up in the 
> help string.  This would be useful when using multiline triple quoted 
> strings to pass in help text to the option parser and you want to indent the 
> help text on each line so the source code reads well.

I use:

def parseargs():
    parser = OptionParser(...)
    parser.add_option('-a', '--age', action='store', default='1w',
                      help="""\
Confirmations older than this value are removed.  age is a float number
followed by one of the following unit specifier letters:

m - minutes
h - hours
d - days
w - weeks""")

-Barry



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4