Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Pythonのデバッガーを使おう
Search
Shinya Okano
June 10, 2023
Technology
980
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pythonのデバッガーを使おう
Shinya Okano
June 10, 2023
More Decks by Shinya Okano
See All by Shinya Okano
プロファイラを使ってPythonアプリをチューニングしよう
tokibito
2
1.5k
Djangoテンプレートエンジンを使いこなそう!
tokibito
0
3.2k
Djangoフレームワークの紹介_OSC北海道2019
tokibito
1
1.1k
DjangoCongressJP開催レポート
tokibito
0
110
Djangoフレームワークの紹介 OSC2018do
tokibito
0
2.9k
Other Decks in Technology
See All in Technology
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
340
HacobuにおけるFDEとは/登壇資料(戸井田 裕貴)
hacobu
PRO
1
700
FinTech 1-2 : Overview of FinTech
ks91
PRO
0
120
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
850
Swap and Memory Reclaim - Squeezing Out More RAM
ennael
PRO
1
1.5k
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
160
全社共通データ基盤をつくる。ソニーのDatabricks活用とデータガバナンス設計の裏側
sony
0
290
行動するAIのためのオントロジー | DevRev — Encraft #26.pdf
dvrv_tknrszk
2
670
インバスケット試験対策アプリを 作って見えたAIエージェント構築 ナレッジ2選
shichijoyuhi
1
110
大阪オフィスに Unitree Go2 がやってきたので Physical AI やってみた
dafujii
0
220
10年欲しかった音楽管理アプリを、AIと一緒に作りはじめた
judau
1
200
2026-09-26 Platform Engineering Kaigi 2026 インフラとアプリの境界線と委譲の設計 / Drawing the Infra and App Line
masasuzu
0
570
Featured
See All Featured
Mind Mapping
helmedeiros
1
390
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Balancing Empowerment & Direction
lara
6
1.3k
WENDY [Excerpt]
tessaabrams
14
40k
Are puppies a ranking factor?
jonoalderson
2
4k
The Invisible Side of Design
smashingmag
301
52k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
500
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
We Are The Robots
honzajavorek
0
380
Art, The Web, and Tiny UX
lynnandtonic
304
22k
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でデバッグする • こちらのほうが手軽