----- Original Message ----- From: "Alan" <alanwilter@gmail.com> To: "Andreas Jung" <lists@zopyx.com> Cc: <zope@zope.org> Sent: Tuesday, February 13, 2007 8:10 AM Subject: Re: [Zope] External Method importing modules
Thanks Andreas, I am trying with:
if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)
where myPath should be '[Zope installation folder]/instance/import'. So my question now is: is there a variable inside Zope which can returns the 'import' path?
You can easily check what's in your sys.path by having your external method return it. Typically, the Extensions directory (where your external methods live) are not in the default path and need to be added to sys.path.(warning: be careful on how you do this or everytime your external method gets called it will add to the sys.path and will eventually cause you grief!). Jonathan