[foo.py]
class A:
    def __init__(self):
        m = __import__(__name__)
        print m.__file__

[IDLE]
>>> import foo
>>> a = foo.A()
C:\Documents and Settings\Super Hacker\My Documents\foo.pyc