修正批量添加字段数据的一个bug
This commit is contained in:
parent
c52ba08d91
commit
c3ddd01426
|
|
@ -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()
|
||||
|
|
|
|||
Reference in New Issue