简体   繁体   中英

I want run a job on buissness days only in the python schedule module

does anyone know how to do this in the python schedule module? there is little to no documention on what I want to do.

my code is:

schedule.every().day.at("21:05:00").do(turn_off)
schedule.every().Monday.at("06:00").do(turn_on)
schedule.every().Tuesday.at("06:00").do(turn_on)
schedule.every().Wednesday.at("06:00").do(turn_on)
schedule.every().Thursday.at("06:00").do(turn_on)
schedule.every().Friday.at("06:00").do(turn_on)
schedule.every().Monday.at("07:40").do(turn_off)
schedule.every().Tuesday.at("07:40").do(turn_off)
schedule.every().Wednesday.at("07:40").do(turn_off)
schedule.every().Thursday.at("07:40").do(turn_off)
schedule.every().Friday.at("07:40").do(turn_off)
schedule.every().Monday.at("16:05").do(turn_on)
schedule.every().Tuesday.at("16:05").do(turn_on)
schedule.every().Wednesday.at("16:05").do(turn_on)
schedule.every().Thursday.at("16:05").do(turn_on)
schedule.every().Friday.at("16:05").do(turn_off)

You can give it a try and confirm if it works for you.

Run schedule from Monday to Friday

schedule.every().monday.to(friday).at("06:00").do(job)
schedule.every().monday.to(friday).at("07:40").do(job)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM