Non-web-based templating system

bruno at modulix onurb at xiludom.gro
Fri Apr 28 08:13:25 EDT 2006


Diez B. Roggisch wrote:
> qscomputing at gmail.com wrote:
> 
> 
>>Hi,
>>
>>I'm creating a small application in Python that uses lists and
>>dictionaries to create a rudimentary database. I'd like to create some
>>"fill-in-the-blanks" reports from this data, ideally by taking an RTF
>>or plaintext file as a template and replacing placeholder tags with my
>>data.
>>Are there any good pre-written systems that would allow me to do this?
> 
> 
> Maybe the built-in string interpolation is sufficient?
> 
> print "Hello %(name)s" % dict(name="Peter Pan")
> 

Else you may want to look at:
- http://www.python.org/doc/2.4.2/whatsnew/node5.html
- empy : http://www.alcyone.com/pyos/empy/
- cheetah :  http://www.cheetahtemplate.org/

HTH
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list