Timer runs only once.

vnthmanoharan at gmail.com vnthmanoharan at gmail.com
Wed Nov 30 09:41:34 EST 2016


from threading import Timer

class TestTimer:
    def foo(self):
        print("hello world")
        self.startTimer()

    def startTimer(self):
        self.t1 = Timer(5, self.foo)
        self.t1.start()

timer = TestTimer()
timer.startTimer()



More information about the Python-list mailing list