path to python file given module

Kartic kartic.krishnamurthy at gmail.com
Mon Jan 10 01:12:03 CET 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