title: Executing a function (with a parameter) every X seconds in python
body: <p>I want to run a code that runs a function with a parameter (eg. greet(h)) every 5 seconds. I tried using <em>threading</em> but it doesn't work. It executes just once. See the code below and the errors:</p>
  
  <pre><code>import threading
  
  oh_hi = "Hi guys"
  
  def greeting(hello):
      print "%s" % hello
  
  
  
  threading.Timer(1, greeting(oh_hi)).start()
  </code></pre>
  
  <p>Error shown below:</p>
  
  <pre><code>&gt; &gt;&gt;&gt; ================================ RESTART
  &gt; ================================
  &gt; &gt;&gt;&gt;  Hi guys
  &gt; &gt;&gt;&gt; Exception in thread Thread-1: Traceback (most recent call last):  
  &gt; File "C:\Python27\lib\threading.py",
  &gt; line 530, in __bootstrap_inner
  &gt;     self.run()   File "C:\Python27\lib\threading.py", line
  &gt; 734, in run
  &gt;     self.function(*self.args, **self.kwargs) TypeError: 'NoneType' object is not callable
  </code></pre>
  
  <p>Kindly assist.</p>
  
  <p>Thanks</p>