[ZPT] Re: [Zope] using ZPT/TAL without zope

smoerk@gmx.de smoerk@gmx.de" <smoerk@gmx.de
Wed, 05 Sep 2001 13:45:38 +0200


I also needed Acquisition, ComputedAttribute, ExtensionClass and
MultiMapping. But this are all *.pyd files (from windows zope 2.4.1),
which I assume are C extensions. Not very plug and play portable.

TAL works without any additional modules with Python 2.x, but I didn't
found a description how to use TAL in Python. Is there any
documentation?

On Wed, 15 Aug 2001 16:15:58 -0400, Evan Simpson wrote:

>smoerk@gmx.de wrote:
>> is it possible to use ZPT without Zope in Python program? 
>
>It is possible to use PageTemplates without Zope, not ZPT (short for 
>Zope Page Templates).  With ExtensionClass, TAL, ZTUtils, and 
>PageTemplates on your Python path, you should be able to:
>
>>>> from PageTemplates.PageTemplate import PageTemplate
>>>> pt = PageTemplate()
> >>> pt.write('''<p tal:define="x options/x"
>...             tal:content="python:x+1">???</p>''')
> >>> print pt(x=1)
><p>11</p>
>
> >>>
>
>Cheers,
>
>Evan @ 4-am & Zope
>