Pretty Print Python Data Structures to HTML

Diez B. Roggisch deets at nospam.web.de
Sat Oct 17 04:28:20 EDT 2009


Sam schrieb:
> I'm looking for something like the pprint module but that can take a
> Python data structure and turn it into HTML (or better xHTML).
> 
> It would read through the data structure but instead of formatting it
> using spaces it would format it using either dd/dt or ordered/
> unordered lists or even as a html table.
> 
> Have I explained this well enough that you can understand what I
> mean?  Is such a library available anywhere?

pprint + pygments should do the job.

Diez



More information about the Python-list mailing list