title: How can I make this timer run forever?
body: <pre><code>from threading import Timer
  
  def hello():
      print "hello, world"
  
  t = Timer(30.0, hello)
  t.start()
  </code></pre>
  
  <p>This code only fires the timer once.</p>
  
  <p>How can I make the timer run forever?</p>
  
  <p>Thanks,</p>
  
  <p><strong>updated</strong></p>
  
  <p>this is right :</p>
  
  <pre><code>import time,sys
  
  def hello():
      while True:
          print "Hello, Word!"
          sys.stdout.flush()
          time.sleep(2.0)
  hello()
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>from threading import Timer
  
  def hello():
      print "hello, world"
      sys.stdout.flush()
      t = Timer(2.0, hello)
      t.start()
  
  t = Timer(2.0, hello)
  t.start()
  </code></pre>