Python Templates


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.

The original post was in the category: python but I'm still in the process of migrating categories over.

The original post had 3 comments I'm in the process of migrating over.