[Zope] Python calling files from ancestor directories?

Dieter Maurer dieter@handshake.de
Wed, 12 Jun 2002 20:44:32 +0200


Alec Munro writes:
 > Any idea how I can use Python to call a file two directories up?
 > So if my python script is at:
 > /root/blah/cgi/someScript
 > 
 > And I want it to return the file:
 > /root/nah/someFile
What do you mean with "call" or "return"?

I assume you are in a Python Script. Then you can (usually) access
"root.nah.someFile" by "context.nah.someFile".

In order for this to work, "/root/nah" must be "nearest" (with respect to
acquisition search order) "nah" to "context".
It would, e.g., not work from "/root/blah/nah/someScript".


Dieter