Looking for very light weight template library (not framework)

Bernard bernard.chhun at gmail.com
Thu Mar 6 23:37:41 EST 2008


Cheetah! Cheetah! Cheetah!

On 6 mar, 20:56, "Malcolm Greene" <pyt... at bdurham.com> wrote:
> New to Python and looking for a template library that allows Python
> expressions embedded in strings to be evaluated in place. In other words
> something more powerful than the basic "%(variable)s" or "$variable"
> (Template) capabilities.
>
> I know that some of the web frameworks support this type of template
> capability but I don't need a web framework, just a library that
> supports embedded expression evaluation.
>
> Use case:
>
> myOutput = """\
>
> The total cost is {{invoice.total}}.
>
> This order will be shipped to {{invoice.contact}} at the following
> address:
>
> {{invoice.address}}
>
> This order was generated at {{some date/time expression}}
> """
>
> Any suggestions appreciated.
>
> Malcolm




More information about the Python-list mailing list