One nice thing about Python is triple-quotes and string substitution make writing templates really simple

page = '''
The time is %(time)s.

print page % { 'title': "Time of day",
               'time': time.asctime() }

The HTML is all by itself with only the simplest Python in the middle of it. And the substitutions are named, not positional, so it's self-documenting. You can substitute the same text more than once. And if you want to be clever, you can use locals() in place of the hand-crafted dictionary to directly substitute Python symbols.

  2004-08-21 16:38 Z