[Zope] Namespace for PythonScript

Chris Withers chris at simplistix.co.uk
Wed Jun 1 15:43:31 EDT 2005


Hong Yuan wrote:
> If a PythonScript is called from a Page Template, how can it access the 
> variables defined using:
>   <tal:define="global ..." />
> in the calling script?

no need for the 'global'

Go to the Bindings tab of your python script, make sure _ is in the box 
for "namespace".

then, in the python script, you can do:

_.getitem('...')

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope mailing list