Python Templates

Alex Martelli aleaxit at yahoo.com
Mon May 28 05:07:54 EDT 2001


"Tom Verbeure" <tverbeure at globespan.net> wrote in message
news:9esiq4$ho$1 at news.monmouth.com...
> Hi All,
>
> I have been programming for quite some time in Perl and want to switch to
> Python. For my first application, I need a library that handles free form
> text templates (=not HTML-only) with embedded Python code, basically like

You just described my little Yet Another Python Template Utility, YAPTU,
http://aspn.activestate.com/ASPN/Python/Cookbook/Recipe/52305.  Have a
look... its functional kernel is just 32 executable lines!  It does get
a BIT kludgy to achieve that -- embedded simple-statements MUST end
with a comment, embedded clauses of compound statements CANNOT end with
a comment, for example:-) -- and I guess a YAPTU2 sacrificing size in
order to remove the strangeness might be warranted, but I have some
attachment to the original one (my very first Python app... and in
'production' use for the multi-natural-language templating of the
http://net.fenx.com/alex/prob.py CGI script to compute conditional
probabilities of suit-division in the game of contract bridge...).


Alex






More information about the Python-list mailing list