Call a function after some interval in Python with Timer


Python tip:

You can use Timer to run some function only after a certain amount of time has passed

An example👇

from threading import Timer


def truth():
    print("Python rocks!")


t = Timer(15, truth)
t.start() # truth will be called after a 15 second interval