title: python threading timer on a class method
body: <p>I have a code block that I use for running a piece of code every 30 secs</p>
  
  <pre><code>def hello():
      print "hello, world"
      t = threading.Timer(30.0, hello)
      t.start()
  </code></pre>
  
  <p>The one below is a method of a class, which I really want to run every 30 secs, but I am having problems with it.</p>
  
  <pre><code>def continousUpdate(self, contractId):    
      print 'hello, world new'
      t = threading.Timer(30.0, self.continousUpdate, [self, contractId],{} )
      t.start()
  </code></pre>
  
  <p>When I run it, I get the following error</p>
  
  <pre><code>pydev debugger: starting
  hello, world new
  Exception in thread Thread-4:
  Traceback (most recent call last):
    File "C:\Python27\lib\threading.py", line 552, in __bootstrap_inner
     self.run()
    File "C:\Python27\lib\threading.py", line 756, in run
     self.function(*self.args, **self.kwargs)
  TypeError: continousUpdate() takes exactly 2 arguments (3 given)
  </code></pre>
  
  <p>I have also tried</p>
  
  <pre><code>def continousUpdate(self, contractId):    
      print 'hello, world new'
      t = threading.Timer(30.0, self.continousUpdate(contractId))
      t.start()
  </code></pre>
  
  <p>which somehow behaves as if it ignores the thread, and gives a recursion limit error</p>