traceback.print_last()

traceback.print_last(limit=None, file=None, chain=True) This is a shorthand for print_exception(sys.last_type, sys.last_value, sys.last_traceback, limit, file, chain). In general it will work only after an exception has reached an interactive prompt (see sys.last_type).

traceback.print_exception()

traceback.print_exception(etype, value, tb, limit=None, file=None, chain=True) Print exception information and stack trace entries from traceback object tb to file. This differs from print_tb() in the following ways: if tb is not None, it prints a header Traceback (most recent call last): it prints the exception etype and value after the stack trace if etype is SyntaxError and value has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the ap

traceback.print_exc()

traceback.print_exc(limit=None, file=None, chain=True) This is a shorthand for print_exception(*sys.exc_info(), limit, file, chain).

traceback.FrameSummary

class traceback.FrameSummary(filename, lineno, name, lookup_line=True, locals=None, line=None) Represent a single frame in the traceback or stack that is being formatted or printed. It may optionally have a stringified version of the frames locals included in it. If lookup_line is False, the source code is not looked up until the FrameSummary has the line attribute accessed (which also happens when casting it to a tuple). line may be directly provided, and will prevent line lookups happening

traceback.format_tb()

traceback.format_tb(tb, limit=None) A shorthand for format_list(extract_tb(tb, limit)).

traceback.format_stack()

traceback.format_stack(f=None, limit=None) A shorthand for format_list(extract_stack(f, limit)).

traceback.format_list()

traceback.format_list(extracted_list) Given a list of tuples as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the same index in the argument list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not None.

traceback.format_exception_only()

traceback.format_exception_only(etype, value) Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError exceptions, it contains several lines that (when printed) display detailed information about where the syntax error occurred. The message indicating which exception occurred i

traceback.format_exception()

traceback.format_exception(etype, value, tb, limit=None, chain=True) Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to print_exception(). The return value is a list of strings, each ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does print_exception().

traceback.format_exc()

traceback.format_exc(limit=None, chain=True) This is like print_exc(limit) but returns a string instead of printing to a file.