The iterator needs an exit condition.
use try/except to solve the problem.
example:
try:
# Set a delay for easy observation
time.sleep(0.1)
# Update in the same line, iterate the output
print("\r", next(pages), end=" ")
# Iteration exit conditions
except StopIteration:
return None
else:
# 递归
test()
Read More:
- [Solved] NPM install Error: check python checking for Python executable python2 in the PATH
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- [Solved] opencv-python: recipe for target ‘modules/python3/CMakeFiles/opencv_python3.dir/all‘ failed
- Linux installs Python and upgrades Python
- Python Error: pip install mysql-connector-python failed
- Opencv-python Install is Stuck Error: running setup.py bdist_wheel for opencv-python
- [Solved] supervisor Error: /usr/local/lib/python2.7/dist-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
- [Solved] Python Error: tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
- npm install Error: stack Error: Can’t find Python executable “python”
- [Solved] cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\……
- Pychar can’t connect to Python console, but it can run. Py file, and Anaconda’s command line can run Python command
- [example multitasking] Python multithreading module
- Full explanation of SYS module of Python
- Python netmiko library Cisco telnet switch automation
- Python uses try… Except… To output detailed errors
- KeyError: b ‘TEST’ problem in python3 conversion from csn-rcnn code
- Python asynchronous execution library asyncio
- Python: LeetCode 43 Multiply Strings
- [Solved] ERROR PythonRunner: Python worker exited unexpectedly (crashed)