Any ideas? How do those paths work?
Also, is it true there's no chance to use relative paths?
You can use os.path.abspath to get absolute path from a relative. However, you might never know which is the current path of the file.
For imported Python modules (IMPORTED! Not main module. Python 2.2 feature!) you can use this:
Code:
import os, sys
mod = sys.modules[__name__]
module_path = os.path.abspath(os.path.dirname(mod.__file__))
path2 = os.path.join(module_path, "..", "foobar")
Then you can guess the installation path of your .py file:
Code:
if os.path.exists(os.path.join("c:", "python", "movz")):
movz_path=os.path.join("c:", "python")
else:
movz_path=os.path.join("e:", "python")