Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

define library path for python external method

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


Dganit.D at puresight

May 11, 2009, 4:22 AM

Post #1 of 3 (2139 views)
Permalink
define library path for python external method

Hi,



I use python script as an external method,

Do you know how to define the python libraries path.

I get an error No module named .....



My program run file when all code is in file or from python directly.





Thanks Dganit


dev101 at magma

May 11, 2009, 5:37 AM

Post #2 of 3 (2050 views)
Permalink
Re: define library path for python external method [In reply to]

<snip>
I use python script as an external method,

Do you know how to define the python libraries path.

I get an error No module named .....
</snip>


Here is something I use in external methods:

EXTDIR = '/apps/zope/Extensions'
import sys
if EXTDIR not in sys.path:
sys.path.append(EXTDIR)


hth

Jonathan
_______________________________________________
Zope maillist - Zope [at] zope
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 )


stefan at epy

May 13, 2009, 12:23 AM

Post #3 of 3 (2024 views)
Permalink
Re: define library path for python external method [In reply to]

You add the additional path to etc/zope.conf using the 'path' directive.

Stefan


On 11.05.2009, at 13:22, Dganit David wrote:

> Hi,
>
> I use python script as an external method,
> Do you know how to define the python libraries path.
> I get an error No module named …..
>
> My program run file when all code is in file or from python directly.
>
>
> Thanks Dganit

_______________________________________________
Zope maillist - Zope [at] zope
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 )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.