html code generation

John Nagle nagle at animats.com
Thu Jan 21 03:30:57 EST 2010


George Trojan wrote:
> I need an advice on table generation. The table is essentially a fifo, 
> containing about 200 rows. The rows are inserted every few minutes or 
> so. The simplest solution is to store row data per line and write 
> directly html code:
> line = "<tr><td>value1</td><td>value2>... </tr>"
> each run of the program would read the previous table into a list of 
> lines, insert the first row and drop the last one, taking care of table 
> header and trailer.
> Is there a more classy solution?
> 
> George

   The "HTMLTemplate" module is good for simple tasks like that.
There are much more elaborate frameworks available, but if all you
need to do is build a table periodically, it's a simple solution.

    This page

	http://www.sitetruth.com/reports/phishes.html

    is built with HTMLtemplate.  It changes only every three hours,
and computing it requires a big SQL join, so it's an automatically
updated static page.

					John Nagle



More information about the Python-list mailing list