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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top