Catching and printing python exceptions
Fri, Oct 27, 2006,
100 Words
>>> import traceback, sys
>>> try:
... 1/0
... except:
... traceback.print_exc(sys.exc_info())
...
Traceback (most recent call last):
File "<stdin>", line 2, in ?
ZeroDivisionError: integer division or modulo by zero
>>>
Previous: How to define a new skin in Zope 3