基于cron表达式的定时任务
Project description
cron-schedule
Installation
pip install cron-schedule
Usage
from datetime import datetime
import time
from schedule import schedule
def do_some_job():
print('do_some_job...', datetime.now())
schedule.add_job(do_some_job, "* * * * * 15,25")
while True:
schedule.run_pending()
time.sleep(1)
do_some_job... 2022-09-23 15:35:15.152107
do_some_job... 2022-09-23 15:35:25.193932
thanks
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cron-schedule-1.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for cron_schedule-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e55e928cf9c472aee6d046f05fb2ac7dc78be0a8c3fffa52a6ef2fab3a2d9a48 |
|
MD5 | 4e9fbd07aab10c27d1c803a459f16125 |
|
BLAKE2b-256 | 8b0e70d464587c9e74e65421baebbced6d1fc250f6e44dcf4e142dd2e5ecd5ab |