python quickie : retrace function steps?

Matt Smith s0199583 at sms.ed.ac.uk
Wed Aug 20 18:20:29 CEST 2003


hi all,

If I was to make a function call another function, and from that
function, call another function (so that now I was in a 3rd function)
something like this:

(function 1)
     |________(function 2) 
                    |________(function 3)

Is there away I can print out the path my Program had taken (i want to
do this as part of my error checking, so a user would always know the
path my program took)?

i.e. printted output of error would be:
                  
            error with function 3
              function 3 called from function 2
              function 2 called from function 1

In perl there is a function called CALLER, which I have used to the
same effect, i was wondering if python had something similar for this?

cheers in advance,
matt




More information about the Python-list mailing list