Refer to function name (newbie ques)

chris ciotti chris_ciotti at attbi.com
Thu Jul 25 18:55:50 EDT 2002


chris_ciotti at attbi.com (chris ciotti) wrote in message news:<805bee23.0207250649.5a4d89d0 at posting.google.com>...
> 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.


Thanks for all the great info!

-- 
chris



More information about the Python-list mailing list