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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
PyBay
August 13, 2017
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
740
2017 - Bringing Python 3 to LinkedIn
pybay
1
620
2017 - Python Debugging with PUDB
pybay
0
810
2017 - Opening up to Open Source
pybay
0
300
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
240
2017 - Performant Asynchronous Programming at Quora
pybay
1
430
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
610
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
750
Other Decks in Programming
See All in Programming
Performance Engineering for Everyone
elenatanasoiu
0
270
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
270
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.5k
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.8k
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.7k
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
4.4k
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.5k
1B+ /day規模のログを管理する技術
broadleaf
0
140
継続モナドとリアクティブプログラミング
yukikurage
3
600
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
210
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
140
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
How to Ace a Technical Interview
jacobian
281
24k
The Spectacular Lies of Maps
axbom
PRO
1
860
WENDY [Excerpt]
tessaabrams
11
38k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
Scaling GitHub
holman
464
140k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Cult of Friendly URLs
andyhume
79
6.9k
Paper Plane
katiecoart
PRO
2
52k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
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