scheduler.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Taigabot 作者: FrozenPigs 项目源码 文件源码
def schedule(timer, priority, command, conn):
    s = sched.scheduler(time.time, time.sleep)
    s.enter(timer, priority, execute, (command, conn))
    s.run()


#from datetime import datetime, timedelta

# def db_init(db):
#     db.execute("create table if not exists scheduler(id primary key, time, action)")
#     db.commit()


#split = inp.split(' ')
#timer = int(inp[0])
#action = " ".join(inp[1:])
#command = 'MODE {} -b {}'.format('#uguubot',action)


#run_at = now + timedelta(hours=3)
#delay = (run_at - now).total_seconds()

# now = datetime.now()
# print now
# change =  timedelta(weeks=0, days=0, hours=0, minutes=1, seconds=0)
# print change
# future = now + change
# print future

# now = datetime.now()
# run_at = now + timedelta(minutes=1)
# delay = (run_at - now).total_seconds()
# threading.Timer(delay, action('test')).start()
#command = 'PRIVMSG {} :{}'.format('#uguubot',inp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号