There is a high level logic error deep within my Python script, and pdb
doesn\'t help to debug it. Is there any other way to see what is being executed after I run
I would recommend using pdb. You can use
import pdb
at the top of your script, and then add the line
pdb.set_trace()
somewhere in the code where you want to trace the problem. When the script gets to that line, you will have an interactive console where you can check variable values, run your own checks, and see what is going on. You can use n
to execute the next line, or c
to continue to the next occurrence of set_trace()
. Full documentation is here: http://docs.python.org/2/library/pdb.html.
Let me know if you have any specific questions!