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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
PyBay
August 13, 2017
Programming
170
0
Share
2017 - Peter Hadlaw - Intro to pdb
PyBay
August 13, 2017
More Decks by PyBay
See All by PyBay
2017 - The Packaging Gradient
pybay
2
1k
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
730
2017 - Bringing Python 3 to LinkedIn
pybay
1
610
2017 - Python Debugging with PUDB
pybay
0
800
2017 - Opening up to Open Source
pybay
0
290
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
230
2017 - Performant Asynchronous Programming at Quora
pybay
1
420
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
590
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
740
Other Decks in Programming
See All in Programming
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.1k
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
300
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
120
3Dシーンの圧縮
fadis
1
470
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
170
今さら聞けないCancellationToken
htkym
0
200
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
1.7k
Inspired By RubyKaigi (EN)
atzzcokek
0
400
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
510
net-httpのHTTP/2対応について
naruse
0
320
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
560
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
sira's awesome portfolio website redesign presentation
elsirapls
0
260
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
Ruling the World: When Life Gets Gamed
codingconduct
0
240
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
370
Into the Great Unknown - MozCon
thekraken
41
2.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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