conditional breakpoint using pdb
问题 Sounds like I'm missing something extremely simple, I'm trying to set a breakpoint in my python code using: if(some condition): pdb.set_trace() My error in the code comes after a large number of iterations..difficult to debug using print etc. I am able to print stuff when the condition hits but I would like to set brk-pt. --EDIT-- Actual code: import pdb if (node_num == 16): print node_num pdb.set_trace() 回答1: I am not sure as to why your code isn't working, but what you can do is on your