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


Groups > comp.lang.python > #51433 > unrolled thread

Generating HTML

Started byMorten Guldager <morten.guldager@gmail.com>
First post2013-07-29 13:41 +0200
Last post2013-07-29 13:41 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#51433 — Generating HTML

FromMorten Guldager <morten.guldager@gmail.com>
Date2013-07-29 13:41 +0200
SubjectGenerating HTML
Message-ID<mailman.5224.1375098077.3114.python-list@python.org>

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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web