title: Schdeuling jobs after calling .start() APscheduler
body: <p>I am writing a program to schedule and cancel alarms in Flask. I am using the apscheduler library for the timings.</p>
  
  <p>I need to be able to add events to the job queue at any point, so I need to be able to add events after the scheduler is run.</p>
  
  <p>Currently, I have:</p>
  
  <pre><code>from apscheduler.schedulers.background import BackgroundScheduler
  
  def cancel():
      job = events[0]
      job.remove()
  
  
  def schedule():
      sched = scheds[0]
      try:
          sched.shutdown()
      except:
          pass
      job = sched.add_job(my_job, 'date', run_date=t, args=['text'])
      events.append(job)
      sched.start()
  
  
  def schedule2():
      sched = scheds[0]
      try:
          sched.shutdown()
      except:
          pass
      job = sched.add_job(my_job, 'date', run_date=t2, args=['text'])
      events.append(job)
      sched.start()
  </code></pre>
  
  <p>Where scheds is an array to store a global scheduler, and events is an array which stores the events that are scheduled.</p>
  
  <p>I need to run schedule, then schedule2, to schedule two different jobs. When I try this, I get an error which says that I cannot run schedule2 because the 'scheduler is already running'. How can I achieve this?</p>