Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51433

Generating HTML

Date 2013-07-29 13:41 +0200
Subject Generating HTML
From Morten Guldager <morten.guldager@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5224.1375098077.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

'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 %-)

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Generating HTML Morten Guldager <morten.guldager@gmail.com> - 2013-07-29 13:41 +0200

csiph-web