Determine calling module's name
jeffgray at my-deja.com
jeffgray at my-deja.com
Thu Aug 10 22:52:20 EDT 2000
More information about the Python-list mailing list
Thu Aug 10 22:52:20 EDT 2000
- Previous message (by thread): Determine calling module's name
- Next message (by thread): Determine calling module's name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Roland Mas <mas at echo.fr> wrote: > So, you raise an exception, and Bob's your uncle: An excellent idea - tres bien! After a little work, I found the following would operate correctly: def LogMessage(message): try: raise Exception() except: modName=sys.exc_info()[2].tb_frame.f_back.f_locals.get('__name__') print modName,':',message Thanks for your help Jeff Sent via Deja.com http://www.deja.com/ Before you buy.
- Previous message (by thread): Determine calling module's name
- Next message (by thread): Determine calling module's name
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list