整理 course 目录:原课程归入同名文件夹,新增学习资料/动手练习分类
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"""预热缓存:把练习需要的数据一次性拉齐(带重试+间隔)。之后离线可跑。"""
|
||||
import time, sys
|
||||
from lib_quant import get_daily, CACHE
|
||||
JOBS = [
|
||||
("600519","20200101","20241231"), ("600519","20230101","20241231"),
|
||||
("000001","20200101","20241231"), ("000001","20230101","20241231"),
|
||||
("300750","20200101","20241231"), ("300750","20230101","20241231"),
|
||||
("601318","20200101","20241231"), ("000858","20200101","20241231"),
|
||||
]
|
||||
for sym,s,e in JOBS:
|
||||
import os
|
||||
f=os.path.join(CACHE,f"{sym}_{s}_{e}_qfq.csv")
|
||||
if os.path.exists(f):
|
||||
print("cached", sym, s); continue
|
||||
for att in range(8):
|
||||
try:
|
||||
df=get_daily(sym,s,e); print("OK", sym, s, len(df)); break
|
||||
except Exception as ex:
|
||||
print("retry",sym,att,repr(ex)[:60]); time.sleep(5+att*3)
|
||||
else:
|
||||
print("FAIL", sym, s); sys.exit(1)
|
||||
time.sleep(3)
|
||||
print("ALL DONE")
|
||||
Reference in New Issue
Block a user