The Austin Python Meetup Message Board › HTML Generation in Python

HTML Generation in Python

Scott B
user 9882819
Austin, TX
Post #: 4
There seem to be a LOT of choices for HTML generation in python:

http://www.livinglogi...­
http://karrigell.sour...­
http://genshi.edgewal...­
https://pypi.python.o...­

All I want is basic HTML generation -- NOT maintaining a website.
I have a python data structure (dictionary of dictionaries type thing), that I want to print to a single HTML page. I want a table of contents based on the top level dictionary's keys. The TOC should be hyperlinked to the body, with hyperlinks back to the TOC. That is about it.
It may be that this is so simple, I'm better off writing raw HTML from python.
Opinions? Thanks.

- Scott
Tim S.
timswast
Austin, TX
Post #: 1
To add to your list of choices, a very popular option that I have used in the past is Jinja2 (http://jinja.pocoo.or...­.

You can pass a dictionary to the template engine to create a table of contents pretty easily. Once you have your template loaded it could be as easy as:

print template.render(mypages=mydictfrompython­)
Powered by mvnForum

Our Sponsors

  • Capital Factory

    Generously providing us a nice meeting space at the top of the Omni!

  • Atlassian

    Providing space, food, drinks for our May 2015 meetup!

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy