From c3ddd01426e79475e2bb7ec02d69229f26480e4e Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Tue, 13 Jun 2023 09:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=89=B9=E9=87=8F=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=E6=95=B0=E6=8D=AE=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具/批量添加字段数据.py | 1 + 1 file changed, 1 insertion(+) diff --git a/工具/批量添加字段数据.py b/工具/批量添加字段数据.py index 38aa56cd..a1d8548e 100644 --- a/工具/批量添加字段数据.py +++ b/工具/批量添加字段数据.py @@ -21,6 +21,7 @@ with open(datafile,"r",encoding="utf8") as f: pos = data.index("\n") field = data[:pos].strip() #文件的第一个非空行的内容为字段名 appending_data = data[pos:] #第一个非空行之后的内容为要添加的数据 +appending_data = re.sub(r"\n[\s]*\n","\n\n",appending_data) with open(r"../题库0.3/Problems.json","r",encoding = "utf8") as f: database = f.read()