Ian Bicking: the old part of his blog

Re: Templating via dict wrappers

you may want to take a look at Templite: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496702

it just lets you embed python code directly into your template.

for example, this code:

tmpl = "Are you %(name|upper)s?!?"

rendered = tmpl % Piper({'name': 'the keymaster', 'upper': lambda x: x.upper()})

becomes:

tmpl = Templite("Are you ${emit(name.upper())}$?!?"

rendered = tmpl(name ="the keymaster")

-tomer

Comment on Templating via dict wrappers
by tomer filiba