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
3k
Djangoフレームワークの紹介_OSC北海道2019
tokibito
1
1.1k
DjangoCongressJP開催レポート
tokibito
0
98
Djangoフレームワークの紹介 OSC2018do
tokibito
0
2.9k
Other Decks in Technology
See All in Technology
基盤を育てる 外部SaaS連携の運用
gamonges_dresscode
1
120
AgentCore×VPCでの設計パターンn選と勘所
har1101
3
290
AI時代のガードレールとしてのAPIガバナンス
nagix
0
300
20260428_Product Management Summit_Loglass_JoeHirose
loglassjoe
2
2.7k
AI時代における技術的負債への取り組み
codenote
1
1.7k
ハーネスエンジニアリングの概要と設計思想
sergicalsix
9
5.1k
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
750
Do Vibe Coding ao LLM em Produção para Busca Agêntica - TDC 2026 - Summit IA - São Paulo
jpbonson
3
140
社内エンジニア勉強会の醍醐味と苦しみ/tamadev
nishiuma
0
230
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
8
2.2k
AI: Making Admin and Users, Lives Better
kbmsg
0
110
ARIA Notifyについて
ryokatsuse
1
120
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7k
The SEO Collaboration Effect
kristinabergwall1
1
420
HDC tutorial
michielstock
2
630
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
From π to Pie charts
rasagy
0
170
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
530
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
The Curse of the Amulet
leimatthew05
1
11k
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でデバッグする • こちらのほうが手軽