[Tutor] Making pretty web pages from python code examples?

Modulok modulok at gmail.com
Tue Apr 13 16:52:21 CEST 2010

Is there an easy way to get a docstring from a python file, without
first importing it?

Basically, I'm trying to read python code examples from files on disk
and generate pretty little web pages from them. I invision the
docstring appearing as the main text on the page, with the rest of the
code in HTML code or pre tags. That way I could just write up a bunch
of python samples, without having to do anything more but upload them.
Maybe something like this exists already? I don't know. I just figured
it would be pretty easy to write, but getting the docstrings without
trying to parse the files was a rut.


More information about the Tutor mailing list