resources/other/schedule.py

The module adapted for Trassir https://github.com/dbader/schedule

Documentation: https://schedule.readthedocs.io/en/stable/

Changes:

  • Added run_continuously() method from https://github.com/mrhwick/schedule to start the tasks in a separate thread.
  • Tasks are called in the main thread via host.timeout(0, job) .

Example:

Running the job function every minute at 00 seconds

import host
import schedule


def job():
    host.message("Hello world!")


schedule.every().minutes.at(":00").do(job)

schedule.run_continuously()


  • Нет меток