path to python file given module

Kartic kartic.krishnamurthy at gmail.com
Sun Jan 9 20:10:04 EST 2005


That is because your module in not in a standard location that python
can find it in. It is not that inspect.getsourcefile() is not working.

Actually if you try reloading your filegen module after the os.chdir(),
you will see that import fails. If you copy your filegen directory to
the site-packages directory of python, you will get the complete path
of the module no matter where you are inside your script.




More information about the Python-list mailing list