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
910
Pythonのデバッガーを使おう
Shinya Okano
June 10, 2023
Tweet
Share
More Decks by Shinya Okano
See All by Shinya Okano
プロファイラを使ってPythonアプリをチューニングしよう
tokibito
2
1.3k
Djangoテンプレートエンジンを使いこなそう!
tokibito
0
2.7k
Djangoフレームワークの紹介_OSC北海道2019
tokibito
1
1.1k
DjangoCongressJP開催レポート
tokibito
0
86
Djangoフレームワークの紹介 OSC2018do
tokibito
0
2.8k
Other Decks in Technology
See All in Technology
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
150
asken AI勉強会(Android)
tadashi_sato
0
110
Node-RED × MCP 勉強会 vol.1
1ftseabass
PRO
0
170
Should Our Project Join the CNCF? (Japanese Recap)
whywaita
PRO
0
260
PHPでWebブラウザのレンダリングエンジンを実装する
dip_tech
PRO
0
210
AWS Organizations 新機能!マルチパーティ承認の紹介
yhana
1
180
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
190
フィンテック養成勉強会#54
finengine
0
180
2025-06-26 GitHub CopilotとAI駆動開発:実践と導入のリアル
fl_kawachi
1
170
mrubyと micro-ROSが繋ぐロボットの世界
kishima
2
360
OpenHands🤲にContributeしてみた
kotauchisunsun
1
480
強化されたAmazon Location Serviceによる新機能と開発者体験
dayjournal
3
230
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
53
7.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Site-Speed That Sticks
csswizardry
10
670
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
A better future with KSS
kneath
239
17k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
Facilitating Awesome Meetings
lara
54
6.4k
Six Lessons from altMBA
skipperchong
28
3.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
Being A Developer After 40
akosma
90
590k
Embracing the Ebb and Flow
colly
86
4.7k
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でデバッグする • こちらのほうが手軽