title: Python - Schedule library - Needs to get busy loop
body: <p>So I have been playing around with schedule and finally got it to work. I was too excited to relized that there came ANOTHER problem haha. However the issue is now that it doesn't end whenever the main is finished and I can't really find the solution. I know the issue sits on the row Time.sleep(1) because whenever I keyboardInterrput then there comes a error saying Time.sleep(1) was the "Issue" and I can't really find a soulution to end it.</p>
  
  <p>Im using a schedule from a github : <a href="https://github.com/dbader/schedule" rel="nofollow noreferrer">https://github.com/dbader/schedule</a></p>
  
  <pre><code>while True:
      UserInput = input('To run Schedule task - Press y\nTo run directly - Press n\n')
  
      if(UserInput == 'y' or UserInput == 'Y'):
          print(Fore.RESET + space)
          TimeUser = input('What time to start script? Format - HH:MM\n')
  
          schedule.every().day.at(TimeUser).do(main)
          wipe()
          print('Schedule starts at: ''' + TimeUser + ' - Waiting for time...')
          idle = int(round(schedule.idle_seconds()))
  
  
  
          while True:
              schedule.run_pending()
              time.sleep(1)
              idle = int(round(schedule.idle_seconds()))
              if(idle &lt; 6.0) and (idle &gt;= 0.0):
                  print('Starting in: ' + str(idle))
  
      elif(UserInput == 'n' or UserInput == 'N'):
          main()
  
  
      print("Wrong input - Try again")
  </code></pre>
  
  <p>I did do get a recommendation from a very kind person about this: 
  schedule library needs that busy loop. The real question here is how the OP can run that busy loop without blocking, and the answer in that library docs is: run it in another thread. If he breaks, the scheduled tasks will not complete</p>
  
  <p><a href="https://schedule.readthedocs.io/en/stable/faq.html#how-to-continuously-run-the-scheduler-without-blocking-the-main-thread" rel="nofollow noreferrer">https://schedule.readthedocs.io/en/stable/faq.html#how-to-continuously-run-the-scheduler-without-blocking-the-main-thread</a></p>
  
  <p>and I quite still don't understand what to do without blocking main. Is there maybe someone that has any idea?</p>