Access function name from within a function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hellmut Weber

    Access function name from within a function

    Hi,
    i would liek to define an error routine which print amongs other things
    the name of the function from which it has been called.

    Having tried

    def foo():
    print dir()

    and all other ideas which came to my (rather python newbie) mind.

    Googling too did not show me a possibility.

    IOW what I'm looking for is:

    def bar():
    name = some_function(s ome-parameter)
    print name

    should print 'bar'

    Any ideas appreciated

    Hellmut

    --
    Dr. Hellmut Weber mail@hellmutweb er.de
    Degenfeldstraße 2 tel +49-89-3081172
    D-80803 München-Schwabing mobil +49-172-8450321
    please: No DOCs, no PPTs. why: tinyurl.com/cbgq

Working...