From b8c569f1025c65ef25fdf31c30a95e2d2a66d891 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 23 八月 2023 18:01:46 +0800 Subject: [PATCH] H/L/S撤日志改为异步 --- utils/data_export_util.py | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/utils/data_export_util.py b/utils/data_export_util.py index 281afc0..f92abcd 100644 --- a/utils/data_export_util.py +++ b/utils/data_export_util.py @@ -50,12 +50,9 @@ local_time = time.strftime("%Y%m%dT%H%M%S", time.localtime(time.time())) file_name = "{}/{}_{}.xls".format(dest_dir, code, local_time) file_name_txt = "{}/{}_{}.txt".format(dest_dir, code, local_time) - openfile = open(file_name_txt, 'w') - try: + with open(file_name_txt, 'w') as openfile: for data in datas: openfile.write(json.dumps(data) + "\n") - finally: - openfile.close() wb = xlwt.Workbook(encoding="utf-8") ws = wb.add_sheet('sheet1') ws.write(0, 0, '搴忓彿') @@ -203,8 +200,8 @@ num_operate_map = {} l2.l2_data_util.load_num_operate_map(num_operate_map, code, datas) for progress in progresses: - deal_big_money_manager.set_trade_progress(code, progress, datas, num_operate_map[code]) + deal_big_money_manager.DealComputeProgressManager().set_trade_progress(code, progress, datas, num_operate_map[code]) if __name__ == "__main__": - export_l2_excel("002765") + export_l2_excel("002178") -- Gitblit v1.8.0