doc generator

Fernando Pérez fperez528 at yahoo.com
Fri Nov 9 17:11:24 EST 2001


> You'll have to pardon _my_ ignorance, because the only thing that I know
> about Teud is "It looks better than HappyDoc". :) I'm generally not
> interested in documentation generators, and haven't touched PyDoc -- I
> just know the authors, and throught it'd be nice of me to plug their project

Well, I'll fill you in a bit (if you're running Python 2.1 you already have 
it). Pydoc is a full blown help/documentation system that now comes with 
python.

As a doc system: in a command line window, type 'pydoc -g'. This will open up 
a little tk window with a search field, and an 'open browser' button. Push 
this button and you'll get a nice webpage in your browser with an index of 
all the modules you have in your sys.path. The docs are updated in real time, 
so if you're working on a module and you modify it, hitting 'reload' in your 
browser will reflect those changes immediately. It's quite nifty.

As help: at the interactive prompt, do 'from pydoc import help'. Then just 
type help. A help system, with access to all your python documentation, will 
pop up (you might have to first set a PYTHONDOCS env variable).

Furthermore, pydoc is based on a module called inspect, which is an 
impressive set of utilities for doing object introspection. So if you ever 
need to do fancy run-time analysis of your own code and objects, the 
functionality (at least all the basic tools) is already there.

Anyway, this is probably worth mentioning b/c I wouldn't be surprised if many 
people didn't even know they already have this in their system. It's a *huge* 
time saver (at least I think so).

Cheers,

f



More information about the Python-list mailing list