Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
160
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
970
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
690
2017 - Bringing Python 3 to LinkedIn
pybay
1
580
2017 - Python Debugging with PUDB
pybay
0
760
2017 - Opening up to Open Source
pybay
0
270
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
210
2017 - Performant Asynchronous Programming at Quora
pybay
1
400
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
550
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
700
Other Decks in Programming
See All in Programming
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
dotfiles 式年遷宮 令和最新版
masawada
1
790
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
510
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.3k
Navigating Dependency Injection with Metro
l2hyunwoo
1
120
Graviton と Nitro と私
maroon1st
0
110
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
190
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
150
SwiftUIで本格音ゲー実装してみた
hypebeans
0
430
AIエージェントの設計で注意するべきポイント6選
har1101
5
860
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
500
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
0
87
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
2
59
Thoughts on Productivity
jonyablonski
73
5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
エンジニアに許された特別な時間の終わり
watany
105
220k
Agile that works and the tools we love
rasmusluckow
331
21k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
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