i normally use the following: import inspect print inspect.getsourcefile( lambda:None ) the lambda function could be any object; the getsourcefile returns the path to the file where that object was defined. _wolf