title: Python timer start and reset
body: <p>I am attempting to get a Timer functionality to work in Python (Python 2.7 currently).</p>
  
  <p>Here is what I have so far. I am struggling with a threading issue and resetting the timer.</p>
  
  <pre class="lang-py prettyprint-override"><code>from threading import Timer
  
  def api_call():
      print("Call that there api")
  
  t = Timer(10.0,api_call)
  
  
  def my_callback(channel):
  
      if something_true:
          print('reset timer and start again')
          t.cancel()
          t.start()
          print("\n timer started")
      elif something_else_true:
          t.cancel()
          print("timer canceled")
      else:
         t.cancel()
         print('cancel timer for sure')
  
  try:
      if outside_input_that_can_happen_a_lot:
          my_callback()
  
  finally:
      #cleanup objects
  </code></pre>
  
  <p>Basically, <code>my_callback()</code> can be called a lot of times very quickly and can hit any part of the "if", "elif", or "else" statements. </p>
  
  <p>The issue I am having is that when the <code>something_true</code> variable is true, then it will start a timer. Which works great <em>the first time</em>. Every time after that that it is called, I get a threading error telling me that only one thread can be used for the timer. </p>
  
  <p>Basically, I want to be able to reset my timer on the first "if" and cancel if the "elif" or "else" is hit.</p>