O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

traceback

The traceback module is used to gather and print stack traces of a program after an exception has occurred. The functions in this module operate on traceback objects such as the third item returned by the sys.exc_info() function.

print_tb(traceback [, limit [, file]])

Prints up to limit stack trace entries from traceback to the file file. If limit is omitted, all the entries are printed. If file is omitted, the output is sent to sys.stderr.

print_exception(type, value, traceback [, limit [, file]])

Prints exception information and a stack trace to file.type is the exception type, and value is the exception value. limit and file are the same as in print_tb().

print_exc([limit [, file]])

Same as print_exception() applied to the information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required