The following can be understood by all pyhton programmers:
""" <html> <head> <title>%s</title> </head> <body> <h1>%s</h1> </body> </html> """ % (mytitle, myheading)
It's never this easy unless it's the simplest of applications :) Speaking of which... Consider using jaxml and the HTML_document class there. Search google for "jaxml". Basically It works like this:
import jaxml h=jaxml.HTML_document() h.html() h.head() h.title() h._text("Hello world") h._pop() h.meta(type="something", refresh="1") print h <?xml version="1.0" encoding="iso-8859-1"?> <html> <head> <title> <text>Hello world</text> Hellow world </title> </head> <meta refresh="1" type="something" /> </html>
I use this module to generate XML and it works great! For HTML I'm not too sure but it appears to be working just fine. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.380 / Virus Database: 213 - Release Date: 2002-07-24