From 43ede61c11064c2279889ca352fc6ec596f9f4d8 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 24 八月 2023 16:31:50 +0800
Subject: [PATCH] 交易通道处理采用线程池

---
 utils/data_export_util.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/utils/data_export_util.py b/utils/data_export_util.py
index 4ef3bec..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, '搴忓彿')
@@ -207,4 +204,4 @@
 
 
 if __name__ == "__main__":
-    export_l2_excel("002765")
+    export_l2_excel("002178")

--
Gitblit v1.8.0