Generating HTML

Morten Guldager morten.guldager at gmail.com
Mon Jul 29 07:41:08 EDT 2013


'Aloha Friends!

Still a bit new to python I'm afraid of choosing  an obsolete route when it
comes to generate some HTML in a Flask based micro web server.

I come from the Perl side where I have been using HTML::Element with great
success, and now I would like to know if something similar exists for
Python?

I would like to construct the complete page as a plain python structure and
then feed it to a function to get a chunk of HTML ready to send to the
client.

Something like:
  table_struct = ['table', ['tr', ['td', {class=>"red"}, "this is
red"],['td', {class=>"blue"}, "this is not red"]]]
  html = struct2html(table_struct)

Suggestions?


-- 
/Morten %-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130729/8e7477f3/attachment.html>


More information about the Python-list mailing list