Using simply exit() or quit() might not work as it might be undefined in some runtime environments Use: sys.exit() to terminate the program explicitly
sys.exit()