[Zope] Python in expressions

Loren Stafford lstafford@icompression.com
Fri, 12 Nov 1999 15:49:37 -0800


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Clarence Gardner
> Sent: Friday, November 12, 1999 15:01
> I'm trying to do a simple Python expression, e.g.,
> 
>     <dtml-if "divmod(33,2) == 1"> a </dtml-if>
> 
> I get a NameError.  I was given to understand that double-quoted
> expressions are normal Python expressions, and divmod is a builtin,

Just for the challenge, I tried this out:

<dtml-var "_.divmod(33,2)">

It returns a tuple (16, 1)

-- Loren