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()