1. Open JUPYTER NOTEBOOK and create a new blank PY document.
You may not be able to see an infinite loop when it occurs, but you can see it by dragging the scroll bar.
At this time, you need to press this small square to stop.
2. Open the SHELL of PYTHON.
It will be more obvious if there is an infinite loop here, and it will keep scrolling.
We need to press CTRL C to terminate.
3. If an infinite loop occurs in PYCHARM, it can only be seen below.
Click the small square on the left, and it will end when it changes from red to colorless.
For more Python related technical articles, please visit the Python Tutorial column to learn!
The above is the detailed content of How to stop the infinite loop of python program. For more information, please follow other related articles on the PHP Chinese website!