title: Best way to keep Python script running?
body: <p>I'm using APScheduler to run some recurring tasks as follows:</p>
  
  <pre><code>from apscheduler.scheduler import Scheduler
  from time import time, sleep
  
  apsched = Scheduler()
  apsched.start()
  
  def doSomethingRecurring():
      pass  # Do something really interesting here..
  
  apsched.add_interval_job(doSomethingRecurring, seconds=2)
  
  while True:
      sleep(10)
  </code></pre>
  
  <p>Because the interval_job ends when this script ends I simply added the ending <code>while True</code> loop. I don't really know if this is the best, let alone pythonic way to do this though. Is there a "better" way of doing this? All tips are welcome! </p>