Re: Using Timer or Scheduler in a Class

2008-08-13 Thread Steven D'Aprano
Hi Justin, Does Professor Battersea know you're using his gmail account? *wink* On Wed, 13 Aug 2008 23:16:12 -0400, Prof. William Battersea wrote: > I'd like a class method to fire every n seconds. > > I tried this: > > class Timed: > def.__init__(self): > self.t = Timer(3, self.d

Re: Using Timer or Scheduler in a Class

2008-08-13 Thread Rob Weir
On 14 Aug 2008, William Battersea wrote: > Both run once and end. I'm obviously missing something here. That's how both ('sched' and threading.Timer) of the them work. Depending on what you're doing, your toolkit/framework (Twisted, GTK, etc) might have a better solution. Or http://www.gossamer-t

Using Timer or Scheduler in a Class

2008-08-13 Thread Prof. William Battersea
I'd like a class method to fire every n seconds. I tried this: class Timed: def.__init__(self): self.t = Timer(3, self.dothing) def.start(self): self.t.start() def.dothing(self): print "Doing Thing" s = new Timed() s.start() And: class Scheduled: def._