Hello Everyone, I have to do this college project on Zope and Python, so I was just messing with ZMI. I am trying to create a new Python script, but I get this error Error Type: ImportError Error Value: import of "yy" from "DateTime" is unauthorized. You are not allowed to access yy in this context The script that causes this error is below from DateTime import yy request = container.REQUEST RESPONSE = request.RESPONSE print "<br>CUrrent time is", yy() return printed The strange thing is that all imports from Products.PythonScripts.standard but any other library does not work. Does anyone know why this happens even though i am logged in as admin. Thanks - Sid __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html
Sid Hegde wrote at 2004-3-19 22:22 -0800:
I have to do this college project on Zope and Python, so I was just messing with ZMI. I am trying to create a new Python script, but I get this error
Error Type: ImportError Error Value: import of "yy" from "DateTime" is unauthorized. You are not allowed to access yy in this context The script that causes this error is below from DateTime import yy
"yy" is a method of "DateTime" instances. It is not found in the "DateTime" package. To use "yy", you would do something like: from DateTime import DateTime # the "DateTime" class myDate = DateTime(...) # create a "DateTime" instance ... myDate.yy() ... # access the intance's "yy" method -- Dieter
participants (2)
-
Dieter Maurer -
Sid Hegde