Simon Forster wrote at 2004-8-9 15:55 +0100:
I would like to make os.popen() available to python scripts added via the Zope management interface [1]. Following a previous posting, people pointed me to zope/lib/python/Products/PythonScripts/README.txt and Paul Winkler added to that a URL <http://www.zopelabs.com/cookbook/1074897091>.
Following the README all I need do is create an __init__.py file with the content:
from Products.PythonScripts.Utility import allow_module allow_module('os.popen')
Most names in the Zope world are well chosen: the named objects do what their name suggests. In the example above, the name is "allow_module". When you take the name seriously, your recognize that it applies to a module. "os.popen" is a function (and not a module). And, as you observe: it does not work... Please take names seriously! There are a few badly chosen names but in general, you can trust them... -- Dieter