for example, a.boo method calls b.foo method. In b.foo method, how can I get a\'s file name (I don\'t want to pass __file__
a.boo
b.foo
__file__
you can use the traceback module:
traceback
import traceback
and you can print the back trace like this:
print traceback.format_stack()
I haven't used this in years, but this should be enough to get you started.