optionparse: how to add a line break to the help text

Ben Finney ben+python at benfinney.id.au
Sun Sep 11 01:20:07 EDT 2011


Gelonida N <gelonida at gmail.com> writes:

> Considering, that you posted the snippet in 2007 and this is very
> probably a reocurring problem for any slighty more complicated help
> text it is really a pity, that it did not become of part of the
> standard optparse library :-(

The ‘optparse’ library is, as the online documentation shows
<URL:http://docs.python.org/library/optparse.html>, deprecated for new
code:

    The optparse module is deprecated and will not be developed further;
    development will continue with the argparse module.

The standard library ‘argparse’ module has a feature you might prefer
<URL:http://docs.python.org/library/argparse.html#formatter-class>.

-- 
 \      “An expert is a man who has made all the mistakes which can be |
  `\                         made in a very narrow field.” —Niels Bohr |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list