I need a starter ptr writing python embedded in html.

alex23 wuwei23 at gmail.com
Mon Aug 9 21:24:29 EDT 2010


"Steven W. Orr" <ste... at syslang.net> wrote:
> I'm ok in python but I haven't done too much with web pages. I have a web page
> that is hand written in html that has about 1000 entries in a table and I want
> to convert the table [into html]

Is the data coming from somewhere like a file or db? If so, I'd just
use something simple like this html generator:

http://pypi.python.org/pypi/html

It's a very clever use of context managers to handle element
nesting :)

If the data doesn't change very often, I'd just write a simple script
that parses the data source and builds a html page to server
statically. If it does, it's not much extra to convert that to a WSGI
script that returns the html string rather than creating a static
file.

I use this approach to produce a browseable table from a folder full
of files with fixed-pattern names.

Hope this helps.



More information about the Python-list mailing list