Trace exceptions

Peter Hansen peter at engcorp.com
Thu Feb 24 23:55:18 EST 2005


gf gf wrote:
> Is there anyway to do something like this:
> 
> try:
>      ...
> except Exception:
>      print the Exception message (and maybe other
> info)

import traceback
traceback.print_exc()

See the docs on that module for how that works and many
other possibilities.

-Peter



More information about the Python-list mailing list