traceback — Print or retrieve a stack traceback — Python 3.14.7 documentation

docs.python.org

Tin mới

atexit — Exit handlers

__future__ — Future statement definitions

Python Module Index

3.14.7 Documentation

The Python Standard Library

Python Runtime Services

Module-Level Functions¶

The module uses traceback objects — these are objects of type types.TracebackType, which are assigned to the __traceback__ field of BaseException instances.

types.TracebackType

The module uses traceback objects — these are objects of type types.TracebackType, which are assigned to the __traceback__ field of BaseException instances.

BaseException.__traceback__

The module uses traceback objects — these are objects of type types.TracebackType, which are assigned to the __traceback__ field of BaseException instances.

faulthandler: Dump the Python traceback.

Used to dump Python tracebacks explicitly, on a fault, after a timeout, or on a user signal.

pdb: The Python debugger for interactive interpreters.

Used to dump Python tracebacks explicitly, on a fault, after a timeout, or on a user signal.

controlled using environment variables

Added in version 3.13: Output is colorized by default and can be controlled using environment variables.

sys.tracebacklimit

The meaning of the limit parameter is different than the meaning of sys.tracebacklimit. A negative limit value corresponds to a positive value of sys.tracebacklimit, whereas the behaviour of a positive limit value cannot

code: Facilities to implement read-eval-print loops.

This simple example implements a basic read-eval-print loop, similar to (but less useful than) the standard Python interactive interpreter loop. For a more complete implementation of the interpreter loop, refer to the co