Inspect - Function Name

Riassunto:

caller function name Documentazione



Codice

import inspect
current_frame = inspect.currentframe()
call_frame = inspect.getouterframes(current_frame, 2)
print('caller frame:', call_frame[1][3])
 
>>> foo