Python script complete exit

Gmanc2 :

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.

sxeros :

This could work:

import os

def ed():
    os._exit(1)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=12576&siteId=1