Women in Technology

Hear us Roar



Article:
  Interactive Debugging in Python
Subject:   pdb module unsung hero
Date:   2005-09-02 12:24:26
From:   neves
My favorite function in pdb module is the set_trace(). It's a lot of time we spend just finding and getting to the exact point where we want to inspect. Just edit your code, add the line import pdb;pdb.set_trace() and rerun your program. When it reaches the desired point, you'll get a debug prompt.


If you are programming test first, put the command in your failing test and see whats failing there.