This talk was given on Saturday, August 3rd 2019 at PyCon Australia in Sydney.
Video
Slides
View the slides on SpeakerDeck, or download them.
Abstract
Still debugging your code with print statements? Learn how to level up your ability to troubleshoot complex code situations by using the power of a fully-featured debugger.
Debuggers allow you to examine your program state, watch as the values of important variables change, and even modify the content of variables on the fly. Once I gave up print statements, my productivity as a programmer increased, and yours can too!
I’ll showcase the variety of debugger tools available - from pdb, the simplest command line debugger that’s part of the standard library, to fancy graphical debuggers available in Python IDEs. Join me as we walk through real code together using debugger tools in a hands-on way to help us diagnose problems and bugs. The skills you’ll learn in this talk will allow you to quickly use these tools in your own code bases for fun, school, or work.
Cheat Sheet
Download the debugger cheat sheet.
Tweets
If you’re used to debugging with ‘print’ statements, it doesn’t have to be scary to transition to using a debugger. @nnja demonstrating this beautifully in a live demo @ #pyconau pic.twitter.com/nRVbTfGZm7
— Belle (@tweety_belle) August 3, 2019
TIL you can prevent `breakpoint()` from inadvertently running in production by setting the environment variable `PYTHONBREAKPOINT=0`. Thanks @nnja!
— Dustin Ingram at #PyCon #PyConUS2021 @pycon (@di_codes) August 3, 2019
Tip from @nnja: use git pre-commit hooks to make sure you don't commit pdb/breakpoint statements to your code #pyconau pic.twitter.com/9s90lkofd5
— Trey Hunner 🐍🍪✨ (@treyhunner) August 3, 2019
Attending @nnja talk about debugging. #pyconau #Python pic.twitter.com/A6P18M5oPY
— Parth Shandilya (@ParthS0007) August 3, 2019
Everyone put up their hands when @nnja asked how many of us use print to debug ✋ #pyconau
— Dr Vicki Lowe 💁🏻♀️ (@weatheredpup) August 3, 2019