title: Start a Function at Given Time
body: <p>How can I run a function in <em>Python</em>, at a given time?</p>
  
  <p>For example:</p>
  
  <pre><code>run_it_at(func, '2012-07-17 15:50:00')
  </code></pre>
  
  <p>and it will run the function <code>func</code> at 2012-07-17 15:50:00.</p>
  
  <p>I tried the <a href="http://docs.python.org/library/sched.html#scheduler-objects" rel="noreferrer">sched.scheduler</a>, but it didn't start my function.</p>
  
  <pre><code>import time as time_module
  scheduler = sched.scheduler(time_module.time, time_module.sleep)
  t = time_module.strptime('2012-07-17 15:50:00', '%Y-%m-%d %H:%M:%S')
  t = time_module.mktime(t)
  scheduler_e = scheduler.enterabs(t, 1, self.update, ())
  </code></pre>
  
  <p>What can I do?</p>