https://github.com/mic1on/cron-schedule
一个基于cron表达式的定时任务调度
https://github.com/mic1on/cron-schedule
Last synced: 11 months ago
JSON representation
一个基于cron表达式的定时任务调度
- Host: GitHub
- URL: https://github.com/mic1on/cron-schedule
- Owner: mic1on
- Created: 2022-09-23T07:51:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-23T08:00:35.000Z (over 3 years ago)
- Last Synced: 2025-01-14T11:14:19.869Z (12 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cron-schedule
## Installation
```bash
pip install cron-schedule
```
## Usage
```python
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)
```
```text
do_some_job... 2022-09-23 15:35:15.152107
do_some_job... 2022-09-23 15:35:25.193932
```
#### thanks
- [croniter](https://github.com/kiorky/croniter)