9 Apr
2002
9 Apr
'02
8:06 p.m.
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