Skip to Content
Python: Essential Reference, Third Edition
book

Python: Essential Reference, Third Edition

by David Beazley
February 2006
Intermediate to advanced content levelIntermediate to advanced
648 pages
14h 53m
English
Sams
Content preview from Python: Essential Reference, Third Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python: Essential Reference

Python: Essential Reference

David M. Beazley

Publisher Resources

ISBN: 0672328623Purchase book