Reputation: 35
I'm currently using quit() to end my program but the command line still persists after the execution has finished. How do I "kill" the program?
def ed():
quit()
timer = threading.Timer(time, ed)
timer.start()
The pointer stays active and acts like the script is running.
Upvotes: 2
Views: 60
Reputation: 5370
You can use standard function of Python exit()
which can print whatever before exiting and exit from program.
print("start")
exit() # exiting from program
print("end")
start
print("start")
exit("exiting") # exiting with output
print("end")
start
exiting
Upvotes: 1