Re: Timer runs only once.

2016-11-30 Thread siva gnanam
On Wednesday, November 30, 2016 at 8:11:49 PM UTC+5:30, vnthma...@gmail.com wrote: > from threading import Timer > > class TestTimer: > def foo(self): > print("hello world") > self.startTimer() > > def startTimer(self): > self.t1 = Timer(5, self.foo) > sel

Re: Timer runs only once.

2016-11-30 Thread siva gnanam
On Wednesday, November 30, 2016 at 7:35:46 PM UTC+5:30, siva gnanam wrote: > The following program print hello world only once instead it has to print the > string for every 5 seconds. > > from threading import Timer; > > class TestTimer: > >

Timer runs only once.

2016-11-30 Thread siva gnanam
The following program print hello world only once instead it has to print the string for every 5 seconds. from threading import Timer; class TestTimer: def __init__(self): self.t1 = Timer(5.0, self.foo); def startTimer(self): self.t1.start();