[Zope] How to call a script by it's name stored in a variable.

robert rottermann robert at redcor.ch
Tue Feb 20 22:54:40 EST 2007


rieh25 wrote:
> How can I do something like this?
> 
> var = '/Projects/test_py'
> 
> return call_by_name(var)
> 
> ------------------------------------
> Thanks.
fun = context.restrictedTraverse(var)
return fun()

then there is path and getattr you should look at.

robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: robert.vcf
Type: text/x-vcard
Size: 200 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070221/1b5e42ed/robert.vcf


More information about the Zope mailing list