문제

I want to set breakpoints using pdb and then run the loop in the program until that breakpoint. and then after checking the values keep continuing (only stopping at that point) until the loop ends. how do i do it?

도움이 되었습니까?

해결책

You can run your program into pdb from the command line by running

python -m pdb your_script.py

This will stop execution at line 1, now set breakpoint with b linenumber e.g. b 25. Now type run it will run the program until that break point.

다른 팁

If you can modify the code, one way is to add this line where you want to break:

import pdb; pdb.set_trace()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top