Re: Optparse and help formatting?
- From: Tim Chase <python.list@xxxxxxxxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 08:51:11 -0500
def format_option(self, option):[snip]
# The help for each option consists of two parts:
# * the opt strings and metavars
Tim, I notice you're using lots of # lines as comments to describe the
function. Perhaps you should consider using docstrings instead.
Pardon me if I'm telling you what you already know...
Yes, I do know about and use docstrings, and no, no offense
taken. You'll have to persuade the [Debian/Python] maintainer of
optparse.py from whom I pilfered the code. :)
tim@rubbish:~$ sed -n '/def format_option(/{N;N;N;N;N;p}'
/usr/lib/python2.4/optparse.py
def format_option(self, option):
# The help for each option consists of two parts:
# * the opt strings and metavars
# eg. ("-x", or "-fFILENAME, --file=FILENAME")
# * the user-supplied help string
# eg. ("turn on expert mode", "read data from FILENAME")
-tim
.
- References:
- Optparse and help formatting?
- From: Tim Chase
- Re: Optparse and help formatting?
- From: Ben Finney
- Re: Optparse and help formatting?
- From: Tim Chase
- Re: Optparse and help formatting?
- From: Steven D'Aprano
- Optparse and help formatting?
- Prev by Date: Re: is it possible to use different font within one wxpython static text widget?
- Next by Date: Re: Can you please give me some advice?
- Previous by thread: Re: Optparse and help formatting?
- Next by thread: Re: Optparse and help formatting?
- Index(es):