Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #13128
| From | Gelonida N <gelonida@gmail.com> |
|---|---|
| Subject | Re: optionparse: how to add a line break to the help text |
| Date | 2011-09-11 16:30 +0200 |
| References | (2 earlier) <op.v1mdm0oba8ncjz@gnudebst> <j4h4dh$60n$1@dough.gmane.org> <4E6C182D.60905@tim.thechases.com> <mailman.964.1315710463.27778.python-list@python.org> <87aaabmz94.fsf@benfinney.id.au> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.993.1315751420.27778.python-list@python.org> (permalink) |
Thanks Ben, On 09/11/2011 07:20 AM, Ben Finney wrote: > Gelonida N <gelonida@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. This explains the reluctance to fix optparse. In 2007 however python 2.7 wasn't really that common though > > The standard library ‘argparse’ module has a feature you might prefer > <URL:http://docs.python.org/library/argparse.html#formatter-class>. Most of my code has to run on python 2.5 / 2.6. I just checked, that argparse can be installed (pip install argparse) (didn't check functionality though) for python 2.5 / 2.6 So depending on the situation I had to decide whether I oblige users of my scripts to install argparse or whether I stick with optparse and just add Tim's custom formatter. Probably I'll go for optparse and Tim's custom formatter for tiny scripts with no dependencies except standard libraries and for argparse for new bigger projects with external module dependencies.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: optionparse: how to add a line break to the help text Rafael Durán Castañeda <rafadurancastaneda@gmail.com> - 2011-09-11 00:16 +0200
Re: optionparse: how to add a line break to the help text "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2011-09-11 02:12 +0100
Re: optionparse: how to add a line break to the help text Gelonida N <gelonida@gmail.com> - 2011-09-11 03:54 +0200
Re: optionparse: how to add a line break to the help text Tim Chase <python.list@tim.thechases.com> - 2011-09-10 21:08 -0500
Re: optionparse: how to add a line break to the help text Gelonida N <gelonida@gmail.com> - 2011-09-11 05:07 +0200
Re: optionparse: how to add a line break to the help text Ben Finney <ben+python@benfinney.id.au> - 2011-09-11 15:20 +1000
Re: optionparse: how to add a line break to the help text Gelonida N <gelonida@gmail.com> - 2011-09-11 16:30 +0200
Re: optionparse: how to add a line break to the help text Tim Chase <python.list@tim.thechases.com> - 2011-09-11 06:05 -0500
Re: optionparse: how to add a line break to the help text Robert Kern <robert.kern@gmail.com> - 2011-09-11 15:22 -0500
csiph-web