The documentation for the OS module does not seem to have information about how to open a file that is not in a subdirectory or the current directory that the script is running in without a full path. My directory structure looks like this.
/home/matt/project/dir1/cgi-bin/script.py
/home/matt/project/fileIwantToOpen.txt
open("../../fileIwantToOpen.txt","r")
Gives a file not found error. But if I start up a python interpreter in the cgi-bin directory and try open("../../fileIwantToOpen.txt","r")
it works. I don't want to hard code in the full path for obvious portability reasons. Is there a set of methods in the OS module that CAN do this?