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

Ben Finney ben+python at benfinney.id.au
Sun Sep 11 07:20:07 CEST 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

    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

 \      “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