path to python file given module

Kartic kartic.krishnamurthy at gmail.com
Sun Jan 9 19:12:03 EST 2005


Try this:;

>>> import filegen
>>> import inspect
>>> print inspect.getsourcefile(filegen.SomeClass)
'C:\\Python23\\Lib\\site-packages\\filegen\filegen.py'

Cheers,
--Kartic




More information about the Python-list mailing list