June 2017
Beginner
352 pages
8h 39m
English
We could continue using next to move through our program's execution, but since we don't know where the bug lies this might not be a very useful technique. Instead, remember that the problem with our program is that it seemed to be running forever. This sounds a lot like an infinite loop!
So rather than stepping through our code, we'll simply let it execute and then we'll use Ctrl+C to break back into the debugger when we think we might be in that loop:
(Pdb) cont^CProgram interrupted. (Use 'cont' to resume).> /Users/sixty_north/examples/palindrome.py(9)digits()-> x = mod(Pdb)
After letting the program run for a few seconds, we press Ctrl+C which halts the program and shows us that we're in the the digits() ...
Read now
Unlock full access