Python logo

上個主題

test --- Python 的回歸測試 (regression tests) 套件

下個主題

稽核事件表

此頁面

  • 回報錯誤
  • 顯示原始碼

導航

  • 索引
  • 模組 |
  • 下一頁 |
  • 上一頁 |
  • Python logo
  • Python »
  • 3.14.0rc3 Documentation »
  • Python 標準函式庫 (Standard Library) »
  • 除錯與效能分析
  • |
  • |

除錯與效能分析¶

這些函式庫幫助你進行 Python 程式開發:除錯器允許你在程式碼中單步 (step) 執行、分析堆疊框 (stack frames) 以及設置中斷點 (breakpoints) 等,效能分析工具執行程式碼並提供關於執行時間的詳細分析,讓你找到程式中的瓶頸 (bottlenecks)。事件稽核 (auditing events) 提供執行時期行為的可見性,否則的話可能需要更侵入性的除錯或修補。

  • 稽核事件表
  • bdb --- 偵錯器框架
  • faulthandler --- 傾印 Python 回溯
    • Dumping the traceback
    • Dumping the C stack
      • C Stack Compatibility
    • Fault handler state
    • Dumping the tracebacks after a timeout
    • Dumping the traceback on a user signal
    • Issue with file descriptors
    • 範例
  • pdb --- Python 偵錯器
    • 偵錯器命令
  • Python 的分析器
    • 分析器簡介
    • Instant User's Manual
    • profile 與 cProfile 模組參考文件
    • Stats 類別
    • What Is Deterministic Profiling?
    • 限制
    • 校正
    • Using a custom timer
  • timeit --- 測量小量程式片段的執行時間
    • 基礎範例
    • Python 介面
    • 命令列介面
    • 範例
  • trace --- 追蹤或追查 Python 陳述式執行
    • 命令列用法
      • 主要選項
      • 修飾子(Modifier)
      • 篩選子(Filter)
    • 程式介面
  • tracemalloc --- 追蹤記憶體配置
    • 範例
      • Display the top 10
      • Compute differences
      • Get the traceback of a memory block
      • Pretty top
        • Record the current and peak size of all traced memory blocks
    • API
      • 函式
      • DomainFilter
      • Filter
      • Frame
      • Snapshot
      • Statistic
      • StatisticDiff
      • Trace
      • Traceback

上個主題

test --- Python 的回歸測試 (regression tests) 套件

下個主題

稽核事件表

此頁面

  • 回報錯誤
  • 顯示原始碼
«

導航

  • 索引
  • 模組 |
  • 下一頁 |
  • 上一頁 |
  • Python logo
  • Python »
  • 3.14.0rc3 Documentation »
  • Python 標準函式庫 (Standard Library) »
  • 除錯與效能分析
  • |
  • |
© 版權所有 2001 Python Software Foundation.
此頁面採用 Python 軟體基金會授權條款第 2 版。
文件中的範例、應用技巧與其他程式碼額外採用了 Zero Clause BSD 授權條款。
更多訊息請見歷史與授權條款。

Python 軟體基金會是一家非營利法人。 敬請捐贈。

最後更新於 9月 23, 2025 (00:19 UTC)。 發現 bug?
以 Sphinx8.2.3建立。