[Zope] Relative paths in Extensions folder

Dieter Maurer dieter@handshake.de
Tue, 9 Apr 2002 22:06:52 +0200


Garikoitz Araolaza writes:
 > p=open('myfile.txt','r')
 > 
 > in a Python module in Extensions folder doesn't work unless you give the 
 > whole absolute path for the file:
 > 
 > p=open('/usr/zope/2.5.0/Extensions/myfile.txt','r')
 > 
 > Is there any way to define relative paths to the files in Extensions, so 
 > that my app works in different systems?
Relative paths are relative to the working directory.

I doubt that their is support to determine the path of an extensions
source file. You may try to check whether there is a "__path__" variable
in the module.


Dieter