Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Times option:
import sched, time
s = sched.scheduler(time.time, time.sleep)
def f():
s.enter(5, 1, f) # Перезапуск через 5 секунд
print(time.time())
f()
s.run()
import threading
def f():
threading.Timer(5.0, f).start() # Перезапуск через 5 секунд
print("Hello!")
f()
import time
def f():
print("Hello!")
while True:
time.sleep(5)
f()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question