Personal tools
You are here: Home Weblog Archive 2006 October 27 Catching and printing python exceptions
Document Actions
  • Send this page to somebody
  • Print this page
  • Add Bookmarklet

Catching and printing python exceptions

by tibi last modified 2006-10-27 00:16
Filed Under:
>>> 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
>>>
Weblog
Atom
RDF
RSS 2.0
Powered by Quills
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: