title: Python Daemon, repeat function every x seconds
body: <p>I want to repeat a function every x seconds when the code its working like deamon in Python 2.6 for Linux.
  I have some code but its giving me a lot of problems. Is it possible to call a another file.py instead to write the code inside?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import daemon   
  import threading
  
  def hello():
      print "hello, world"
      t = threading.Timer(2.0, hello).start()
  
  def run():
      with daemon.DaemonContext():
          hello()
  
  if __name__ == "__main__":
      run()
  </code></pre>