Currently I can get the function name using this command:
sys._getframe().f_code.co_name
I want to put it in of function like this:
def func_name:
return sys._getframe().f_code.co_name
this function always returns 'func_name'. Is it possible to get the name the function which is calling this function?
tracebackgives you the whole stack - docs.python.org/2/library/traceback.html so I presume you can get what you want from there