I wrote a program in IDLE to tokenize text files and it starts to tokeniza 349 text files! How can I stop it? How can I stop a running Python program?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
When I have a python script running on a linux terminal, CTRL + \ works. (not CRTL + C or D)
Press Ctrl+Alt+Delete and Task Manager will pop up. Find the Python command running, right click on it and and click Stop or Kill.
Control+D works for me on Windows 10. Also, putting
exit()
at the end also works.you can also use the
Activity Monitor
to stop the py processexit() will kill the Kernel if you're in Jupyter Notebook so it's not a good idea. raise will stop the program.
You can also do it if you use the
exit()
function in your code. More ideally, you can dosys.exit()
.sys.exit()
might terminate Python even if you are running things in parallel through themultiprocessing
package.