This is a development version (latest) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython latest / IPython / core / ultratb

module

IPython.core.ultratb

source: /IPython/core/ultratb.py :0

Members

Summary

Verbose and colourful traceback formatting.

Extended Summary

ColorTB

I've always found it a bit hard to visually parse tracebacks in Python. The ColorTB class is a solution to that problem. It colors the different parts of a traceback in a manner similar to what you would expect from a syntax-highlighting text editor.

Installation instructions for ColorTB

import sys,ultratb
sys.excepthook = ultratb.ColorTB()

VerboseTB

I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds of useful info when a traceback occurs. Ping originally had it spit out HTML and intended it for CGI programmers, but why should they have all the fun? I altered it to spit out colored text to the terminal. It's a bit overwhelming, but kind of neat, and maybe useful for long-running programs that you believe are bug-free. If a crash does occur in that type of program you want details. Give it a shot--you'll love it or you'll hate it.

Installation instructions for VerboseTB

import sys,ultratb
sys.excepthook = ultratb.VerboseTB()

Note: Much of the code in this module was lifted verbatim from the standard library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.

Inheritance diagram:

Additional content

Verbose and colourful traceback formatting.

ColorTB

I've always found it a bit hard to visually parse tracebacks in Python. The ColorTB class is a solution to that problem. It colors the different parts of a traceback in a manner similar to what you would expect from a syntax-highlighting text editor.

Installation instructions for ColorTB

import sys,ultratb
sys.excepthook = ultratb.ColorTB()

VerboseTB

I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds of useful info when a traceback occurs. Ping originally had it spit out HTML and intended it for CGI programmers, but why should they have all the fun? I altered it to spit out colored text to the terminal. It's a bit overwhelming, but kind of neat, and maybe useful for long-running programs that you believe are bug-free. If a crash does occur in that type of program you want details. Give it a shot--you'll love it or you'll hate it.

Installation instructions for VerboseTB

import sys,ultratb
sys.excepthook = ultratb.VerboseTB()

Note: Much of the code in this module was lifted verbatim from the standard library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'.

Inheritance diagram:

Aliases

  • IPython.core.ultratb