function name

Brendan Abel 007brendan at gmail.com
Wed Apr 28 21:07:01 CEST 2010


On Apr 28, 11:44 am, Richard Lamboj <richard.lam... at bilcom.at> wrote:
> Hello,
>
> is there any way to get the name from the actual called function, so that the
> function knows its own name?
>
> Kind Regards,
>
> Richi

If you want to get the function name from within the function itself,
check out the inspect module.
http://docs.python.org/library/inspect.html#inspect.currentframe



More information about the Python-list mailing list