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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shinya Okano
June 10, 2023
Technology
960
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エージェント設計実践
amacbee
1
2.5k
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
340
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
170
イベントストーミングとKiroの仕様駆動開発で実現する要件の認識合わせプロセス
syobochim
7
1.1k
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
2
210
Ruby::Boxでできること、Refinementsでできること
joker1007
3
380
形式手法特論:公平性制約の位相的特徴づけ #kernelvm / Kernel VM Study Kansai 12th
ytaka23
1
710
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
230
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
180
Agentic ERPをどう設計するか ー 受発注エージェントを動かす、現場の知見と設計思想ー
recerqainc
1
1.2k
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
150
ポスター発表&デモと総括 / Poster Presentations & Demonstrations and Summary
ks91
PRO
0
190
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Skip the Path - Find Your Career Trail
mkilby
1
140
A better future with KSS
kneath
240
18k
Building an army of robots
kneath
306
46k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
230
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
170
The Mindset for Success: Future Career Progression
greggifford
PRO
0
350
Writing Fast Ruby
sferik
630
63k
エンジニアに許された特別な時間の終わり
watany
107
250k
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でデバッグする • こちらのほうが手軽