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
860
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
620
2017 - Opening up to Open Source
pybay
0
230
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
170
2017 - Performant Asynchronous Programming at Quora
pybay
1
350
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
480
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
570
Other Decks in Programming
See All in Programming
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.3k
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.7k
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
Linux && Docker 研修/Linux && Docker training
forrep
23
4.5k
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
130
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
1
170
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
Honoとフロントエンドの 型安全性について
yodaka
4
250
動作確認やテストで漏れがちな観点3選
starfish719
6
1k
Honoをフロントエンドで使う 3つのやり方
yusukebe
4
2.1k
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2.6k
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
540
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Making Projects Easy
brettharned
116
6k
It's Worth the Effort
3n
184
28k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
8
270
Being A Developer After 40
akosma
89
590k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
A Philosophy of Restraint
colly
203
16k
Typedesign – Prime Four
hannesfritz
40
2.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
310
Navigating Team Friction
lara
183
15k
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