This document is for an old version of Python that is no longer supported. You should upgrade, and read the Python documentation for the current stable release.

Navigation

  • index
  • modules |
  • next |
  • previous |
  • Python Β»
  • 3.7.17 Documentation Β»
  • The Python Standard Library Β»
  • |

Debugging and ProfilingΒΆ

These libraries help you with Python development: the debugger enables you to step through code, analyze stack frames and set breakpoints etc., and the profilers run code and give you a detailed breakdown of execution times, allowing you to identify bottlenecks in your programs.

  • bdb β€” Debugger framework
  • faulthandler β€” Dump the Python traceback
    • Dumping the traceback
    • Fault handler state
    • Dumping the tracebacks after a timeout
    • Dumping the traceback on a user signal
    • Issue with file descriptors
    • Example
  • pdb β€” The Python Debugger
    • Debugger Commands
  • The Python Profilers
    • Introduction to the profilers
    • Instant User’s Manual
    • profile and cProfile Module Reference
    • The Stats Class
    • What Is Deterministic Profiling?
    • Limitations
    • Calibration
    • Using a custom timer
  • timeit β€” Measure execution time of small code snippets
    • Basic Examples
    • Python Interface
    • Command-Line Interface
    • Examples
  • trace β€” Trace or track Python statement execution
    • Command-Line Usage
      • Main options
      • Modifiers
      • Filters
    • Programmatic Interface
  • tracemalloc β€” Trace memory allocations
    • Examples
      • Display the top 10
      • Compute differences
      • Get the traceback of a memory block
      • Pretty top
    • API
      • Functions
      • DomainFilter
      • Filter
      • Frame
      • Snapshot
      • Statistic
      • StatisticDiff
      • Trace
      • Traceback

Previous topic

test β€” Regression tests package for Python

Next topic

bdb β€” Debugger framework

This Page

  • Report a Bug
  • Show Source

Navigation

  • index
  • modules |
  • next |
  • previous |
  • Python Β»
  • 3.7.17 Documentation Β»
  • The Python Standard Library Β»
  • |
Β© Copyright 2001-2025, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Apr 16, 2025. Found a bug?
Created using Sphinx 2.3.1.