一个简明的调度模块——用于Python的简明调度。

conciseSchedules的Python项目详细描述


简明日程安排

PyPI

简明工作进度表

一、“crontab任务”,court,crontab,shell,subprocess,子过程。存放。 一、“调度任务”,crontab,conciseschedules,可调用python,线程。存放。

工作日程安排

简明日程{
“second”:int或none或tuple(strat,end), “minute”:int或none或tuple(strat,end), “小时”:int或none或tuple(strat,end), “day”:int或none或tuple(strat,end), “月”:int或none或tuple(strat,end), “工作日”:int或none或tuple(strat,end), } 一、无。无。 没有,没有。 2.国际关系,>;=0;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;国际关系;八。如果传-1, 则相当于crontab "*/1"的语法, 即"每1(秒, 分, 时, 日, 月, 周)", 其中'weekday' 0表示星期日, 1-6表示星期一至星期六, 传-1的话, 会被解释为每周启动一次, 且时间设定为每周1的1点1分启动. 3.输入法。

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test.py


def test():
    print('hello conciseSchedules!', test.__name__)


if __name__ == '__main__':
    import conciseSchedules as scheduler

    tasks_conf = {
        'schedule_tasks':[
        {'schedule':{'second': -1}, 'target': test,}    # 每秒钟启动一次
        {'schedule':{'minute': -1}, 'target': test,}    # 每分钟启动一次. 默认是每分钟的第1秒.
        {'schedule':{'second': 15, 'minute': (10-20))}, 'target': test,}    # 每小时的10-12分的第15秒启动
        {'schedule':{'hour': -1)}, 'target': test,}           # 每小时启动一次.默认是每小时的1分1秒.
        {'schedule':{'minute': 1, 'hour': 10, 'day': 1, 'month': 10)}, 'target': test,}     # 每年10月1日10点1分启动.
        ], 
    }
    scheduler.set_tasks(tasks_conf)
    scheduler.run_loop()

这样就

你还可以这样:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test.py


def test():
    print('hello conciseSchedules!', test.__name__)


if __name__ == '__main__':
    import conciseSchedules as scheduler

    task = {'schedule_tasks': {'schedule':{'second': -1}, 'target': test,}}    # 每秒钟启动一次
    scheduler.add_task(task)
    scheduler.run_loop()

承办单位。

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test.py

import conciseSchedules as scheduler


@scheduler.task(schedule={'second': -1})
def test():
    print('hello conciseSchedules!', test.__name__)


if __name__ == '__main__':
    scheduler.run_loop()

[谚]功能测定法一、功能

已完成
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test.py

import conciseSchedules as scheduler


@scheduler.task(schedule={'second': -1}, args=('Tony'), kwargs={'age': 18})
def test(name, age=None):
    print('hello conciseSchedules!', name, age)


if __name__ == '__main__':
    scheduler.run_loop()

合作伙伴关系。注“工作日程安排”合作方式,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab,crontab。

================

下面是“crontab_tasks”施工合作:

crontab“日”发出。支持语:“”政府,“/3”3(25972;38500;3),“1-10”1至10间,“1”31934;30830到1.例:“/11**”横切。如果 周 的参数是 " /1", 则表示每周启动一次, 且启动时间在周1, 如果是" /> 1", 则会被解释成"能 整除 大于1的数的星期几启动" 而不是每年的第几周启动. 至after它,请21442;考crontab档。

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# test.py
def test():
    print('hello conciseSchedules!', test.__name__)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# start.py


if __name__ == '__main__':
    import conciseSchedules as scheduler
    tasks_conf = {
        'crontab_tasks':[
        {'crontab':'*/1 ', 'target': test,}    # 每分钟启动一次. 默认是每分钟的第1秒.
        {'crontab':"", 'target': test,}    # 每小时的10-12分启动
        {'crontab':{'hour': -1)}, 'target': test,}           # 每小时启动一次.默认是每小时的1分1秒.
        {'crontab':{'minute': 1, 'hour': 10, 'day': 1, 'month': 10)}, 'target': test,}     # 每年10月1日10点1分启动.
        ], 
    }
    scheduler.set_tasks(tasks_conf)
    scheduler.run_loop()
    """如果要配合系统 crontab 来使用, 请使用 scheduler.run() 方法"""

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ws-consumer服务地址中的java动态属性   java如何比较整数列表,然后按升序排序?   javascript我正在使用java脚本调用一个函数,但它没有调用代码下面的方法,也没有调用secretitnames()函数   在文本窗格中多次使用Java insertIcon图标   JavaMSAL安卓。AuthenticationActivity完成,但用于身份验证请求的线程池线程仍处于等待状态   if语句中的java多范围比较   java toString()表示输出   java如何在jcstrest测试中生成指令重新排序   java我怎样才能运行它?   web应用程序中使用Hibernate和Spring的java问题   如何将字符串数据写入Java文本文件   如何在java命令提示符下运行已签名的jar文件?   java从我的菜单调用RCP应用程序   java如何等待Canvas/GraphicsContext完成任务,然后再继续执行代码块?