How to retrieve the filename of a module

Lawrence Oluyede raims at
Thu Oct 20 18:27:22 CEST 2005

Il 2005-10-20, mku <martin.kuner at> ha scritto:
> Hi,
> thereŽs a function inside a module. How can these function retrieve
> the path+name   of his module ? (The path is most important).
> That should also work if the module is part of a package.

rhymes at voodoo:~ $ cat >
print __file__
import os
print os.path.abspath(__file__)

rhymes at voodoo:~ $ python



More information about the Python-list mailing list