I have a script and it doesn't work proper, so in bash I let script in while loop and I wanna my script can close itself after a while, I tried to use threading.timer
but my code wont run quit()
or exit()
command, could anyone please help me?
#!/usr/bin/env python3
import threading
from time import sleep
def qu():
print("bye")
exit()
t=threading.Timer(5.0,qu)
t.start()
while(True):
sleep(1)
print("hi")