Generating HTML

M

Morten Guldager

'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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,742
Latest member
AshliMayer

Latest Threads

Top