Programmatic HTML?

Jack Diederich jack at performancedrivers.com
Mon Mar 17 13:14:12 EST 2003


On Mon, Mar 17, 2003 at 05:57:38PM +0000, Afanasiy wrote:
> I have a use for a Python module which would allow
> me to call functions which generate common HTML.
> 
> A simple example of which might be :
> 
>   html.link('http://example.com','Example Website')

I use this, and it works.  It follows the HTML standard and will carp
if you try to add properties not in the standard.  Other than that, it works
pretty well (it seems to generate superfluous whitespace, but not enough
that that I've bothered to hack on it).

http://dustman.net/andy/python/HyperText/

ex/
  print HTML.A('Click here to read about us', href = "about_us.html")

<A HREF="about_us.html">Click here to read about us</A>

-jackdied





More information about the Python-list mailing list