Literate programming in Python

A.M. Kuchling amk at mira.erols.com
Wed Jan 17 21:08:21 EST 2001


On Wed, 17 Jan 2001 22:07:40 GMT, Giuseppe Bilotta <oblomov at freemail.it> wrote:
>I'd like to know if there exist a "literate programming" language for
>Python (possibly using the same structure/conventions of WEB/CWEB,
>the first literate programming languages, developed by D.E.Knuth and
>Silvio Levy, resp. for Pascal and C/C++).

There's Interscript by Max Skaller, at interscript.sourceforge.net;
the Web site doesn't seem to have any examples, so I don't know if its
syntax is CWEBish.  

Also, do a Google search for py2tex, a program that typesets Python
code very nicely and allows putting TeX commands into comments.  This
means there's no tangle phase (source->compilable/executable code),
and the document produced by typesetting it will be in the same order
as the Python code.  Personally I like this; when I tried CWEB, it was
too difficult to keep both two different orderings -- the expository
order for human readers, and the source file order so that the tangled
file would actually compile.

(Hmm... py2tex hasn't been maintained for a while.  I'm greatly
tempted to take it over...)

--amk



More information about the Python-list mailing list