The web.template module currently only provides one function, pasrse(), used to parse a template.
type='python', dict=None [,file=None][,template=None][,useCompiled='auto']) |
'python'
, 'cheetah'
, 'xyaptu'
or 'dreamweaverMX'
. A 'python'
template is a string using the dictionary filling format.
None
, template must be specified.
None
, file must be specified.
Simple example:
>>> import web.template >>> print web.template.parse(dict={'w':'World!'}, template="Hello %(w)s") Hello World!
This is the same as doing this in Python:
>>> print "Hello %(w)s"%{'w':'World!'} Hello World!