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?
To stop a python script using the keyboard: Ctrl + C
Ctrl
C
To stop it using code (This has worked for me on Python 3) :
import os os._exit(0)
you can also use:
import sys sys.exit()
or:
exit()
raise SystemExit