Is it possible to execute the code asynchronously in predefined intervals in Python like it's done in JS using the setTimer?
For example, the function example() will be called every 60 seconds in Python. How can I do that?
Is it possible to execute the code asynchronously in predefined intervals in Python like it's done in JS using the setTimer?
For example, the function example() will be called every 60 seconds in Python. How can I do that?
import threading
def printit():
threading.Timer(5.0, printit).start()
print "Hello, World!"
printit()
the answer from: Run certain code every n seconds