Stress-Free Debugging in Python

Dorian Puła

Software Development Engineer @ Points


Who Am I?

Debug All the Things!

  1. print() All the Things!
    • Pepper code with print() + Guessing games
  2. Use the IDE! Maybe...
    • Fragile + Not always available
  3. PDB
    • The right way + but UNIX beard required

Debugging the IPython Way!!

IPython + PDB = ❤

Installing ipdb

pip install ipdb

Setting a Breakpoint

import ipdb

-- or --

import ipdb; ipdb.set_trace()

Live Demo

General Commands

Running Code Directly

import ipdb'object.function(2)')

Using ipdb Everywhere

Adding to virtualenvwrapper


pip install ipython
pip install ipdb

More About ipdb + IPython

Thank You!