Skip to main content

基于cron表达式的定时任务

Project description

cron-schedule

Package version Supported Python versions

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


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)

Uploaded Source

Built Distribution

cron_schedule-1.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page