----- Original Message ----- From: "Dieter Maurer" <[EMAIL PROTECTED]>
To: "Alan" <[EMAIL PROTECTED]>
Cc: <zope@zope.org>
Sent: Tuesday, October 03, 2006 2:06 PM
Subject: Re: [Zope] external method: importing and updating method


Alan wrote at 2006-10-2 18:48 +0100:
In my external method I have something like this:
...
sys.path.insert(0, CCPNPYTHON)

This is not a good idea!

The source of an "External Method" can be read arbitrarily often --
and each time, you extend "sys.path"...

We get around this 'evergrowing' path problem by (if there is a problem with this solution let me know!):

import sys
SOMEPATH = '/some/path/goes/here'
if SOMEPATH not in sys.path:
   sys.path.append(SOMEPATH)


Jonathan

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to