How can I exit my entire Python application from one of its threads? sys.exit() only terminates the thread in which it is called, so that is no help.
sys.exit()
I w
The easiest way to exit the whole program is, we should terminate the program by using the process id (pid).
import os import psutil current_system_pid = os.getpid() ThisSystem = psutil.Process(current_system_pid) ThisSystem.terminate()
To install psutl:- "pip install psutil"