Equivalent of perl's Pod::Usage?

Adam Funk a24061 at ducksburg.com
Mon Dec 10 06:50:57 EST 2007


On 2007-12-08, Neil Cerutti wrote:

> 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. 

Sorry about that!  POD is a mark-up language that Perl's Pod::Usage
module can translate into man pages (and other documentation formats).

So what I'm really after is an easy way to generate something that
looks like a man page.


> 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.

Thanks.



More information about the Python-list mailing list