[Zope] External Method importing modules

Andreas Jung lists at zopyx.com
Tue Feb 13 08:15:39 EST 2007



--On 13. Februar 2007 13:10:17 +0000 Alan <alanwilter at gmail.com> wrote:

> Thanks Andreas, I am trying with:
>
> if sys.path.count(myPath) == 0: sys.path.insert(0, myPath)

What's the sense of this code? sys.path is usually *never* empty.
You should really look at the Python docs and learn where Python is looking 
by default for modules. Is is perfectly documented -> python.org -> 
documentation.

In addition you would like to check for the existence of an item in 
sys.path using

 if myPath in sys.path:



-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070213/70628338/attachment.bin


More information about the Zope mailing list