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
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
MySQLのSpatial(GIS)機能をもっと充実させたい ~ MyNA望年会2025LT
sakaik
0
150
Microsoft Agent Frameworkの可観測性
tomokusaba
1
120
業務の煩悩を祓うAI活用術108選 / AI 108 Usages
smartbank
9
16k
Building Serverless AI Memory with Mastra × AWS
vvatanabe
1
730
ESXi のAIOps だ!2025冬
unnowataru
0
410
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
240
[Neurogica] 採用ポジション/ Recruitment Position
neurogica
1
140
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.9k
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
170
日本Rubyの会: これまでとこれから
snoozer05
PRO
6
250
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
9.9k
小さく、早く、可能性を多産する。生成AIプロジェクト / prAIrie-dog
visional_engineering_and_design
0
140
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Building an army of robots
kneath
306
46k
Typedesign – Prime Four
hannesfritz
42
2.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Building Applications with DynamoDB
mza
96
6.9k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
150
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
34
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
RailsConf 2023
tenderlove
30
1.3k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
150
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でデバッグする • こちらのほうが手軽