Equivalent of perl's Pod::Usage?

Neil Cerutti horpner at yahoo.com
Sat Dec 8 09:05:10 EST 2007


On 2007-12-08, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On Fri, 7 Dec 2007 20:12:21 +0000, Adam Funk <a24061 at ducksburg.com>
> declaimed the following in comp.lang.python:
>
>> I'm using to using Pod::Usage in my Perl programs (a snipped example
>> is shown below, if you're interested) to generate a little man page
>> when they are called with the -h option.
>> 
>> Is there an equivalent in Python?
>>
> 	I'd suggest you look in the Python references for docstring and/or
> __doc__

I found the example incomprehensible, so I looked it up in
perldoc. Anyhow, Python doesn't have it. Combining printing
various verboseness of usage messages with setting exit codes
with calling the exit function seems a little bizarre.

But I believe optparse will handle parsing arguments and printing
usage messages, though not, I think, setting verbosity levels and
exiting the program.

-- 
Neil Cerutti



More information about the Python-list mailing list