with_schedule_example.py 378 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. __author__ = "heider"
  4. __doc__ = r"""
  5. Created on 8/22/22
  6. """
  7. __all__ = []
  8. import schedule
  9. import time
  10. def job():
  11. print("I'm working...")
  12. schedule.every(10).minutes.do(job)
  13. schedule.every().hour.do(job)
  14. schedule.every().day.at("10:30").do(job)
  15. while 1:
  16. schedule.run_pending()
  17. time.sleep(1)