I have two python files: main.py and imported.py. I want to import imported.py into main.py but I want access to the path of main.py in the file imported.py. That is I want access to the path of the importing module. For example:
#main.py
import imp
imported = imp.load_source('imported', "/absolute/path/to/imported.py")
#imported.py
pathToImportingModule=os.path.???
doSomethingWithPath(pathToImportingModule)