Inspect - currentframe

Riassunto:

Ricevi tutte le informazioni che potresti desiderare sulla funzione chiamante



Utilizzo

import inspect
current_frame = inspect.currentframe()
call_frame = inspect.getouterframes(current_frame, 2)
print('caller name:', call_frame[1][2])

Per utilizzi più avanzati: