Getting "current" module file ?

Olivier DECKMYN olivier.deckmyn at
Sat Feb 10 14:03:54 EST 2001

Hi all,

I am looking for a magic function that would tell me where is stored the
file that is currently running.
A good example is better that thousands of words :

here is /home/olivier/python/ :
import string

print "The current module test1 is stored in", magic_get_location()

would get :
The current module test1 is stored in /home/olivier/python/

Thanx for your support.

ps : Python is real nice piece of code...

More information about the Python-list mailing list