How can I know the name of "caller"

gerrit.holl at gmail.com gerrit.holl at gmail.com
Tue Jun 19 17:18:51 EDT 2007


On Jun 19, 10:50 pm, Stefan Sonnenberg-Carstens
<stefan.sonnenb... at pythonmeister.com> wrote:
> billiejoex schrieb:
> > ...(if it is possible) how can I get, from method "called", the name
> > of function/method that called it (in this case "caller")?

> inspect.stack is your friend ;-)

If you start doing such things on a regular basis, it will sooner or
later become your enemy.

Gerrit.




More information about the Python-list mailing list