I use pdb for this purpose. I understand that Emil already mentioned this in his answer, but he did not include an example or did not specify why he answers your question.
for thing in set_of_things: import pdb; pdb.set_trace() do_stuff_to(thing)
You can read and set variables by starting your command with an exclamation mark. You can also move up and down the stack ( u and d commands), which the InteractiveConsole does not have built-in mechanisms.
To keep the program running, use the c command. In the above example, it will inject a debugger into each iteration of the loop, so you can wrap the set_trace() call in an if clause.
Lauritz V. Thaulow Nov 17 '12 at 18:02 2012-11-17 18:02
source share