how to import strptime.py to ZOPE WIN installation?
Hi, I want to do some form typechecking on the server side for date input. Strptime() is what I need, but the function is not part of the windows distribution. So I was happy to discover strptime.py from Andy Eskilsson (http://www.fukt.hk-r.se/~flognat), which works nicely from the commandline in PythonWin. But how the hell (sorry) can I get it "into" my Python/ZOPE installation? I´d like to call it from a Python script. Reading lots of list archives and the like didn´t give me a clue yet. Please help! Hope I am not off topic (is this a Python thing?), but others might be interested in strptime.py functionality as well. thanks, -georg-
On 22 Apr 2001 19:18:58 +0200, Georg Rellensmann wrote:
Hi,
I want to do some form typechecking on the server side for date input. Strptime() is what I need, but the function is not part of the windows distribution. So I was happy to discover strptime.py from Andy Eskilsson (http://www.fukt.hk-r.se/~flognat), which works nicely from the commandline in PythonWin.
But how the hell (sorry) can I get it "into" my Python/ZOPE installation? I´d like to call it from a Python script. Reading lots of list archives and the like didn´t give me a clue yet. from the help function in Zope 2.3.1 i got the following info, which actually works for me. I wanted to import urlparse into a pythin script. In my /var/zope-2.3.1/Products directory (INSTANCEHOME, where i install all my local and not "standard" Zope products) i created a directory `Modules' and in this directory a file __init__.py in this file i wrote the following:
from Products.PythonScripts.Utility import allow_module, allow_class from AccessControl import ModuleSecurityInfo, ClassSecurityInfo from Globals import InitializeClass allow_module("urlparse"); and then i could import urlparse into a python script. see also help->script(python)->allowing import of modules.
Please help!
Hope I am not off topic (is this a Python thing?), but others might be interested in strptime.py functionality as well.
-- Michael Lausch See my web page <http://www.lausch.at/> or query PGP key server for PGP key. "Reality is that which, when you stop believing in it, doesn't go away". -- Philip K. Dick
participants (2)
-
Georg Rellensmann -
Michael Lausch