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
840
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
600
2017 - Bringing Python 3 to LinkedIn
pybay
1
520
2017 - Python Debugging with PUDB
pybay
0
590
2017 - Opening up to Open Source
pybay
0
220
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
160
2017 - Performant Asynchronous Programming at Quora
pybay
1
340
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
470
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
530
Other Decks in Programming
See All in Programming
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
Refactor your code - refactor yourself
xosofox
1
260
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
190
Zoneless Testing
rainerhahnekamp
0
120
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
920
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
210
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
270
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Site-Speed That Sticks
csswizardry
2
190
Docker and Python
trallard
42
3.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
How to Ace a Technical Interview
jacobian
276
23k
Side Projects
sachag
452
42k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
KATA
mclloyd
29
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Producing Creativity
orderedlist
PRO
341
39k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
RailsConf 2023
tenderlove
29
940
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