[Zope] access to external text file

Max M maxm at mxm.dk
Fri Feb 27 12:11:16 EST 2004


elena at hpcf.upr.edu wrote:

 > I'm new to Zope. I need access to a text file external to Zope to extract
 > some input information for my Zope database.
 > I installed the LocalFs.1-0-0 product. As soon as I added a LocalFS
 > object, my folder became unaccesible. I could access it after I removed
 > LocalFS product.
 > Can you advice me how to read an external text file with or without 
LocalFS?


I don't know in which way you need to read the external file, but an 
external method can do it just as easily as you would do it in Python 
itself:


def read_external_file(self):
     f = open('path_to_file', 'rb')
     content = f.read()
     f.close()
     return content



More information about the Zope mailing list