From 9d3606913262c582b89cd4cf538e4cae96ea2db1 Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Tue, 12 Mar 2024 18:37:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=BD=95=E5=85=A5remark?= =?UTF-8?q?=E6=97=B6=E5=8E=9F=E6=9D=A5=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF=EF=BC=88=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E4=BB=A5\\\\\n=E5=BC=80=E7=AB=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index 7bd9ac25..ff83e02d 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -567,6 +567,9 @@ def AppendData(prodict,fieldsdict,field_id_and_content): #用添加方式修改 if fieldType == "str": if content.strip() in prodict[id][field]: print("题号 %s 的 %s 字段, 内容 %s 已存在"%(id,field,content)) + elif prodict[id][field].strip() == "": + prodict[id][field] = content.strip() + print("已于 %s 的 %s 字段执行添加, 内容为 %s"%(id,field,content)) else: prodict[id][field] = (prodict[id][field].strip() + "\\\\\n" + content).strip() print("已于 %s 的 %s 字段执行添加, 内容为 %s"%(id,field,content))