Is there a way to find the name of the method currently being executed?
Craeg K Strong
cstrong at arielpartners.com
Wed Sep 25 23:02:40 EDT 2002
print "func1 being called"
print "func2 being called"
In the code sample above, I would like to replace the "func1"
and "func2" strings with constants so the same code could
be copied verbatim into multiple functions and do the right
Is there a way to do this in Python? For example, maybe you could
get your hands on the call stack and print out stack.__name__
Thanks in advance,
BTW, I could not find this in the python.org FAQ....
More information about the Python-list