Back in 2003, I was playing around with building templates in Python by taking advantage of a combination of dictionary-based string substitution and the ability to late bind dictionary values using __getitem__.
I posted some graded examples to the Python Web SIG at the time and tonight I dug them up and formatted them into HTML with colour syntax highlighting:
http://jtauber.com/2006/05/templates.html
UPDATE (2006-05-19): One of my Pythonista heros, Ian Bicking, suggests an alternative approach which I like a lot.