Refer to function name (newbie ques)

chris ciotti chris_ciotti at attbi.com
Thu Jul 25 10:49:24 EDT 2002


Hi - 

Is there a way to get the name of the running function?  In a  script
I'm doing some error checking and I want to be able to name the
function that screws up.  Something like:

def foo():
    #stuff here
    
        if stuff != bar:
            outfile.write("Mismatch in function %s\n" % (refer to
foo() here)


Sorry if this is really obvious.  Thanks.

-- 
chris



More information about the Python-list mailing list