Python Traceback Module
Exception traceback handling — format_exc, print_exc, extract_tb. This category documents 5 Python traceback module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: traceback.format_exc(), traceback.print_exc(), traceback.extract_tb(), traceback.format_tb(), traceback.print_last(). traceback.format_exc() returns the formatted traceback of the current exception as a string. traceback.print_exc() prints the formatted traceback of the current exception to stdout/stderr. traceback.extract_tb() extracts a traceback into a list of FrameSummary objects. traceback.format_tb() formats a traceback as a list of strings. traceback.print_last() prints the last formatted exception. Traceback Module belongs to the Dev Tools group alongside Inspect Module, Pdb Module, Timeit Module, GC Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground. Python Reference documents 978+ functions, methods, and modules across 114 categories of the standard library, and every entry in this Traceback Module category follows the same format — syntax first, then what it does, the parameters it accepts, what it returns, and a working code example — so once you have read one page you can read them all.