James Tauber

journeyman of some

blog > 2006 > 05 >

James Tauber's Blog 2006/05/13

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.

by jtauber : Created on May 13, 2006 : Last modified May 19, 2006 : Categories python : 3 comments (permalink)