Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
2017 - Peter Hadlaw - Intro to pdb
Search
PyBay
August 13, 2017
Programming
210
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
Transcript
17 slides
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
More Decks by PyBay
See All by PyBay
2017 - The Packaging Gradient
pybay
2
1.1k
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
790
2017 - Bringing Python 3 to LinkedIn
pybay
1
660
2017 - Python Debugging with PUDB
pybay
0
870
2017 - Opening up to Open Source
pybay
0
330
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
260
2017 - Performant Asynchronous Programming at Quora
pybay
1
470
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
650
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
790
Other Decks in Programming
See All in Programming
エージェントの管理もエージェントに – herdr-core と自作バックログで作る司令塔 –
nearme_tech
PRO
2
190
あなたはMCPの機能を、まだ知らない。
4geru
1
770
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
490
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.4k
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
620
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
360
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
180
Kiro Crewによる開発体験ーKiro CrewでStrands Decider 2B に関する技術検証をやってみた
satoshi256kbyte
1
240
Datadog を OTel にするメリットを考察する — Datadog との併用を実アプリで確かめる / Examining the Benefits of Moving Datadog to OTel — Testing OTel Alongside Datadog in a Real App
seike460
PRO
1
130
AppFunctionsの内部実装を紐解く
hiroaki404
1
130
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
1
1.8k
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.2k
Building an army of robots
kneath
307
47k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Building Applications with DynamoDB
mza
96
7.3k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
370
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4.1k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Being A Developer After 40
akosma
92
590k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k