From 41189104ca4c6f0b1881fb2aacfbd7316e2cd542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E6=9E=97=E9=BE=99?= <10182100242@stu.ecnu.edu.cn> Date: Thu, 28 Jan 2021 18:50:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'be'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/my_check_logic_error.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/be/my_check_logic_error.py b/be/my_check_logic_error.py index 60bccbd..8c2ac91 100644 --- a/be/my_check_logic_error.py +++ b/be/my_check_logic_error.py @@ -34,9 +34,16 @@ def check_logic_error() : response = requests.request("GET", url, headers=headers, data=payload) - print(response.text) + response = json.loads(response.text) + # print(response) + data = response['data'] + name = data['name'] + prob = data['prob'] + checkinfo = list(zip(name, prob)) + print(checkinfo) with open('check_logic_error.txt', 'w', encoding='utf-8', newline='') as f: # 设置文件对象 - f.write(response.text) # 将字符串写入文件中 + f.write(checkinfo) # 将字符串写入文件中 f.close() - return response.text + + return checkinfo