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
200
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
1.1k
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
750
2017 - Bringing Python 3 to LinkedIn
pybay
1
630
2017 - Python Debugging with PUDB
pybay
0
840
2017 - Opening up to Open Source
pybay
0
320
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
250
2017 - Performant Asynchronous Programming at Quora
pybay
1
450
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
630
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
760
Other Decks in Programming
See All in Programming
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
270
이 함수, 실패하면 어떻게 되나요? null부터 Rich Errors까지, Kotlin 에러 처리 15년
haeti2
0
110
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
360
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
190
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
120
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
51
32k
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
420
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
480
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.6k
ALB ログから Trace を気合で繋げる技術
fohte
7
840
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
260
仕様駆動開発の消費期限
watany
20
9.2k
Featured
See All Featured
The browser strikes back
jonoalderson
0
1.6k
Technical Leadership for Architectural Decision Making
baasie
3
550
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
460
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
320
Building an army of robots
kneath
306
46k
Documentation Writing (for coders)
carmenintech
77
5.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
How to Talk to Developers About Accessibility
jct
2
530
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