Files
sanguo_vnpy_v2/scripts/qmt_relogin/qmt_find_strategy.py
T

24 lines
856 B
Python

# -*- coding: utf-8 -*-
"""Locate QMT strategy (formula) storage + run-state flags under userdata."""
import os
import time
d = open(r"C:\sanguo_bigqmt\qmt_install_dir.txt", encoding="utf-8").read().strip()
root = os.path.dirname(d)
base = os.path.join(root, "userdata", "users")
print("BASE", base.encode("unicode_escape").decode("ascii"))
for dirpath, dirnames, files in os.walk(base):
dirnames[:] = [x for x in dirnames if x.lower() != "__pycache__"]
rel = os.path.relpath(dirpath, base)
print("D " + rel.encode("unicode_escape").decode("ascii"))
for f in sorted(files)[:80]:
p = os.path.join(dirpath, f)
try:
st = os.stat(p)
except OSError:
continue
print(" f %-44s %9d %s" % (
f, st.st_size,
time.strftime("%m-%d %H:%M", time.localtime(st.st_mtime))))