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
1
930
Pythonのデバッガーを使おう
Shinya Okano
June 10, 2023
Tweet
Share
More Decks by Shinya Okano
See All by Shinya Okano
プロファイラを使ってPythonアプリをチューニングしよう
tokibito
2
1.4k
Djangoテンプレートエンジンを使いこなそう!
tokibito
0
3k
Djangoフレームワークの紹介_OSC北海道2019
tokibito
1
1.1k
DjangoCongressJP開催レポート
tokibito
0
95
Djangoフレームワークの紹介 OSC2018do
tokibito
0
2.8k
Other Decks in Technology
See All in Technology
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
450
使いにくいの壁を突破する
sansantech
PRO
1
120
Databricks Free Edition講座 データサイエンス編
taka_aki
0
290
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
210
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
120
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
100
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
760
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
410
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.9k
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.7k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.1k
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Faster Mobile Websites
deanohume
310
31k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
Speed Design
sergeychernyshev
33
1.5k
How to Ace a Technical Interview
jacobian
281
24k
Mind Mapping
helmedeiros
PRO
0
77
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
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でデバッグする • こちらのほうが手軽