python 定时任务之顺序执行多个py脚本

python 定时任务有多种方法可以实现,想要定时且顺序执行多个脚本怎么实现,代码如下:

# -*- coding:utf-8 -*-
# Author: lee

import os
from time import sleep

def run():
	while 1:
	    os.system("python ./脚本1.py")
	
	    print('Waiting a minute ...')
	    sleep(5)
	
	    os.system("python ./脚本2.py")
	
	    # 定时 1小时 后执行
	    print("Wait for 1 hours to resume the crawler task!")
	    sleep(3600)
	   
run()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章