|
import time |
|
import sched |
|
import subprocess |
|
|
|
schedule = sched.scheduler(time.time, time.sleep) |
|
|
|
|
|
|
|
def task1(): |
|
print("延迟执行的任务") |
|
|
|
subprocess.call(["python", "数据获取\\get股票拼接.py"]) |
|
|
|
|
|
def task2(): |
|
print("延迟执行的任务") |
|
|
|
subprocess.call(["python", "数据获取\\tradelist.py"]) |
|
|
|
|
|
def task3(): |
|
print("延迟执行的任务") |
|
|
|
subprocess.call(["python", "数据获取\\单指标排名收益分布.py"]) |
|
|
|
|
|
def task4(): |
|
print("延迟执行的任务") |
|
|
|
subprocess.call(["python", "数据获取\\多指标排名收益分布.py"]) |
|
|
|
|
|
|
|
now = time.time() |
|
target_time = now + 7200 |
|
|
|
schedule.enterabs(target_time, 1, task1, []) |
|
|
|
schedule.run() |
|
|
|
schedule.enterabs(target_time, 1, task2, []) |
|
|
|
schedule.run() |
|
|
|
schedule.enterabs(target_time, 1, task3, []) |
|
|
|
schedule.run() |
|
|
|
schedule.enterabs(target_time, 1, task4, []) |
|
|
|
schedule.run() |
|
|