[Zope] Evaluating python with my own variable bindings

Evan Simpson evan@4-am.com
Mon, 05 Aug 2002 17:16:46 -0500


Ross Boylan wrote:
> I would like to bind symbols to values, e.g, Q1=True, Q2=False.... and
> then allow the user to specify arbitary logical expressions like
> Q3 and Q4
> 
> or (given different bindings)
> Q2 == 5

If you only want to allow expressions (not statements), you should 
probably look at lib/python/Products/PageTemplates/ZRPythonExpr.py, 
which defines encapsulated Python expressions and allows you to pass 
arbitrary context to them.

Cheers,

Evan @ 4-am