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])
>>> fooSearch
Jul 31, 20241 min read
Riassunto:
caller function name Documentazione
import inspect
current_frame = inspect.currentframe()
call_frame = inspect.getouterframes(current_frame, 2)
print('caller frame:', call_frame[1][3])
>>> foo