正则表达式

import re
filename=r'E:*.BLK'
with open(filename, 'r',encoding='utf-8', errors='ignore') as f:
data=f.read()
r=re.compile(r'(S[Z|H]\d{6}?)', re.S)
data=re.findall(r, data)
now_time=time.strftime("%H:%M:%S",time.localtime())
print(now_time)
if is_trader_time(now_time):
time.sleep(15)
else:
time.sleep(10*60)
if now_time>'15:00:00':
exit()

你可能感兴趣的:(正则表达式)