getting name of the function you're in

Andrew Dalke dalke at dalkescientific.com
Wed May 15 16:59:55 EDT 2002


Richard Townsend:
>    try:
>        raise ZeroDivisionError
>    except ZeroDivisionError:
>        # Get the traceback object
>        tb = sys.exc_info()[2]

As mentioned in this newsgroup in other threads, I've learned
a bunch of old habits which need to change because of newer
tricks in Python.

sys._getframe()

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list