You could also use sys.excepthook if you're trying to handle uncaught exceptions.<br><br><br><br><div><span class="gmail_quote">On 27 Mar 2007 11:45:54 -0700, <b class="gmail_sendername"><a href="mailto:irstas@gmail.com">
irstas@gmail.com</a></b> <<a href="mailto:irstas@gmail.com">irstas@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Mar 27, 9:15 pm, <a href="mailto:kyoso...@gmail.com">kyoso...@gmail.com</a> wrote:<br>> Technically speaking, you can catch all errors as follows:<br>><br>> try:<br>>    # do something<br>> except Exception, e:
<br>>    print e<br><br>That won't catch exceptions/errors that don't derive from<br>Exception class. For example a string won't be caught:<br><br>try:<br>   raise "foo"<br>except Exception, e:<br>
   print e<br><br>But this will catch all exceptions:<br><br>try:<br>   raise "foo"<br>except:<br>   print sys.exc_info()<br><br>(there may be other ways I don't know of)<br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">
http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br>