Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Pythonのデバッガーを使おう
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Shinya Okano
June 10, 2023
Technology
950
1
Share
Pythonのデバッガーを使おう
Shinya Okano
June 10, 2023
More Decks by Shinya Okano
See All by Shinya Okano
プロファイラを使ってPythonアプリをチューニングしよう
tokibito
2
1.4k
Djangoテンプレートエンジンを使いこなそう!
tokibito
0
3.1k
Djangoフレームワークの紹介_OSC北海道2019
tokibito
1
1.1k
DjangoCongressJP開催レポート
tokibito
0
100
Djangoフレームワークの紹介 OSC2018do
tokibito
0
2.9k
Other Decks in Technology
See All in Technology
AI全盛の今だからこそ、あえてもう一度振り返るAPIの基礎
smt7174
3
140
[みん強]AIの価値を最大化するデータ基盤戦略:Self-Service型Data Meshへの転換とAgentic AI Meshに向けた取り組み with Snowflake他
y_matsubara
1
160
AI Agent に“攻略本”を渡したら、150フォームの移行が回り始めた話/登壇資料(高橋 悟生)
hacobu
PRO
0
200
アプリブロック機能のつくりかたと、AIとHTMLの不合理な相性の良さについて
kumamotone
1
260
サプライチェーン攻撃への備えについて考えている #湘なんか
stefafafan
2
2k
AI-Assisted Contributions and Maintainer Load - PyCon US 2026
pauloxnet
1
190
可視化から活用へ — Mesh化・Segmentation・アライメントの研究動向
gpuunite_official
0
230
DI コンテナ自動生成ツールを実装してみた / intro-autodi
uhzz
0
710
TSKaigi 2026 - 型プラグインシステムの実装に使われるテクニック
teamlab
PRO
0
110
The Making of AI Chips
pfn
PRO
0
510
論文紹介:Pixal3D (SIGGRAPH 2026)
tenten0727
0
630
Claude Code / Codex / Kiro に AWS 権限を 渡すとき、何を設計すべきか
k_adachi_01
6
1.9k
Featured
See All Featured
Statistics for Hackers
jakevdp
799
230k
The Limits of Empathy - UXLibs8
cassininazir
1
330
Six Lessons from altMBA
skipperchong
29
4.2k
Visualization
eitanlees
151
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
550
Scaling GitHub
holman
464
140k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
Mobile First: as difficult as doing things right
swwweet
225
10k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
150
WENDY [Excerpt]
tessaabrams
10
37k
Google's AI Overviews - The New Search
badams
0
1k
Transcript
Pythonのデバッガーを 使おう @tokibito
Pythonのプログラムをデバッグする • デバッグ方法は色々 • print関数を入れる? • ロギングlogging.debug関数を使う? • 組み込みのデバッガーpdbモジュール
pdbモジュール • https://docs.python.org/ja/3/library/pdb.html • 標準で入っている • CUIで使える • Pythonがあれば通常どこでも使えるので覚えておくとよい
ブレークポイントをコード内に指定 • 組み込みのbreakpoint()関数 • import pdb; pdb.set_trace()
pdbから起動する • python -m pdb my-script.py
pdbのコマンド • b: ブレークポイント指定 • ファイル名:行番号 • c: ブレークポイントまで継続 •
s: ステップ実行 • l: 現在の実行位置を表示 • n: 次の呼び出しまで進む • q: 終了
pdb以外のデバッガ • ipdb • IPythonのインターフェースなので使いやすい • pudb • CUIだがリッチなデバッガー
他のデバッグ方法 • VSCodeでデバッグする • こちらのほうが手軽