[SciPy-user] formatting python code for html

Stefan van der Walt stefan at sun.ac.za
Sat Aug 18 07:24:58 EDT 2007


On Tue, Aug 14, 2007 at 11:15:06PM +0900, David Cournapeau wrote:
> Ryan Krauss wrote:
> > Can anyone recommend a good tool to turn Python code into something
> > nicely formatted to display in html?  I am thinking for something that
> > gets results like the Latex listings package without having to run
> > Latex - and with output that could display natively in a web browser,
> > i.e. not pdf or dvi.
> >
> > Any suggestions would be welcome.  A python script that generates
> > nicely formatted html would be the best solution I can think of.
> >   
> http://pygments.org/ is what I used for my own website. It does many 
> languages, and is written in python.

Using emacs, htmlize-buffer will convert the current buffer (with
syntax highlighting) to html.

Cheers
Stéfan



More information about the SciPy-User mailing list