Python, PyCharm: PyCharm debugging cannot stop at the wrong position

When using PyCharm to debug a python program, the debugger will automatically stop at the location of the error and display the current status for viewing: I
Insert picture description here
have been curious about whether the small red lightning symbol on the left can be operated and interacted, until there is a time when the hand is clicked, the icon becomes A small hollow lightning:
Insert picture description here

After exiting the debugger, I found that the program could not stop automatically because of an error, but would exit directly...

After searching for a long time, I finally found a way to recover in the view breakpoints: the
Insert picture description here
small red lightning symbol is similar to the breakpoint manually set by the user, so that the program can stop at the wrong place. After the program is closed, the program cannot be interrupted at the wrong place. The small lightning symbol cannot be reproduced, and the error interrupt cannot be turned on in the program interface.
The correct way is to enable "python exception breakpoint" in the view breakpoints, and then it can be automatically interrupted when an error occurs.
Insert picture description here

Guess you like

Origin blog.csdn.net/PianGe_zyl/article/details/115332142