来自—-迷惑的世纪—-群友提供参考方案
from datetime import datetime
OPEN_HOUR, OPEN_MINUTE = 21, 0
while True:
api.wait_update()
if api.is_changing(quote, “datetime”):
now = datetime.strptime(quote.datetime, “%Y-%m-%d %H:%M:%S.%f”)
# 到达开盘时间,
if (now.hour == OPEN_HOUR and now.minute >= OPEN_MINUTE) :
print(“到达开盘时间”)
break
while True:主程序循环