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
2017 - Peter Hadlaw - Intro to pdb
Search
PyBay
August 13, 2017
Programming
0
130
2017 - Peter Hadlaw - Intro to pdb
PyBay
August 13, 2017
Tweet
Share
More Decks by PyBay
See All by PyBay
2017 - The Packaging Gradient
pybay
2
880
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
620
2017 - Bringing Python 3 to LinkedIn
pybay
1
540
2017 - Python Debugging with PUDB
pybay
0
660
2017 - Opening up to Open Source
pybay
0
240
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
170
2017 - Performant Asynchronous Programming at Quora
pybay
1
360
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
490
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
580
Other Decks in Programming
See All in Programming
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
8
1.5k
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
1
220
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
930
JAWS Days 2025のインフラ
komakichi
1
130
楽しく向き合う例外対応
okutsu
0
710
ナレッジイネイブリングにAIを活用してみる ゆるSRE勉強会 #9
nealle
0
160
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
160
技術を改善し続ける
gumioji
0
160
Honoとフロントエンドの 型安全性について
yodaka
7
1.5k
Introduction to kotlinx.rpc
arawn
0
770
Boos Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
490
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
183
22k
Agile that works and the tools we love
rasmusluckow
328
21k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
For a Future-Friendly Web
brad_frost
176
9.6k
The Cult of Friendly URLs
andyhume
78
6.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
580
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
KATA
mclloyd
29
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
Transcript
INTRO TO pdb Peter Hadlaw @ Tesorio August 13, 2017
https://www.tesorio.com/careers
TOO OFTEN I SEE... print foo print foo['bar'] print fizz.buzz()
...
CONS: Limited (can't interrupt execution) Messy (lot's of clean up)
Zero interactivity (need to modify code and run everything again) Much harder to dive deeper into third party code (internal or external alike)
DEBUGGER Exist in many languages and platforms Python's built-in debugger
is... "A computer program that assists in the detection and correction of errors in computer programs."
pdb
THREE EASY STEPS 1. Set a breakpoint 2. Run program
3. Execution halts at breakpoint and now, you, interact
SETTING A BREAKPOINT import pdb; pdb.set_trace() Using a one liner
is a nice habit to make clean up easier (e.g. a single dd in vi).
api.py
RUN PROGRAM
l - LIST COMMAND
EXPRESSIONS
n - NEXT COMMAND
s - STEP COMMAND
c - CONTINUE COMMAND
GENERAL FLOW Use l to orient yourself and inspect what
code is currently being executed. Use n to step forward in execution Use s to dive deeper Create expressions for the debugger to evaluate and gain insights into what's happening c to continue execution until next breakpoint / finish Profit.
NOTES More commands and features available iPython version, much more
powerful (has to be installed separately) Other languages have debuggers to, for example JavaScript in the browser, or C (gdb)
WE'RE HIRING https://www.tesorio.com/careers