From 59f746fc801513c4a9b59030216c0b8e2d3073da Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 21 五月 2025 16:46:50 +0800 Subject: [PATCH] L2大单解析 --- l2_data_parser.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/l2_data_parser.py b/l2_data_parser.py index e59f03a..2a54e59 100644 --- a/l2_data_parser.py +++ b/l2_data_parser.py @@ -49,16 +49,25 @@ fdatas = [] with open(f"{base_path}/Transaction.csv", 'r', encoding='utf-8') as file: csv_reader = csv.reader(file) + total_lines = csv_reader.line_num + print("鎬昏鏁帮細", total_lines) # 鑾峰彇琛ㄥご锛�: [ExchangeID,SecurityID,TradeTime,TradePrice,TradeVolume,ExecType,MainSeq,SubSeq,BuyNo,SellNo,Info1,Info2,Info3,TradeBSFlag,BizIndex,LocalTimeStamp] headers = next(csv_reader) print("琛ㄥご:", headers) # 閬嶅巻鏁版嵁琛� _path = f"{base_path}/Transaction_filter.csv" + percent = 0 with open(_path, 'w', newline='', encoding='utf-8') as csvfile: # 鍒涘缓涓�涓� CSV 鍐欏叆鍣ㄥ璞� writer = csv.writer(csvfile) # 閫愯鍐欏叆鏁版嵁 + count = 0 for row in csv_reader: + count += 1 + p = count * 100 // total_lines + if p != percent: + percent = p + print(f"**杩涘害锛歿percent}%") if row[1] not in target_codes and not parse_all: continue # 灏嗘枃浠跺啓鍏ュ埌鏂囨湰 -- Gitblit v1.8.0