Possible Duplicate:
How do I get the name of a function or method from within a Python function or method?
The below code function return it's name.
It works but I still have to specify the 'test.' in front of of the __name__
.
Is there any general way to refer the __name__
?
def test():
print test.__name__