15 lines
506 B
Python
15 lines
506 B
Python
import json
|
|
|
|
"""编辑完成保存关闭后运行这个代码块"""
|
|
|
|
with open(r"../题库0.3/Problems.json","r",encoding = "utf8") as f:
|
|
database = f.read()
|
|
pro_dict = json.loads(database)
|
|
|
|
with open(r"临时文件/problem_edit.json","r",encoding="u8") as f:
|
|
datanew = f.read()
|
|
new_pro = json.loads(datanew)
|
|
for id in new_pro:
|
|
pro_dict[id] = new_pro[id].copy()
|
|
with open(r"../题库0.3/Problems.json","w",encoding = "utf8") as f:
|
|
f.write(json.dumps(pro_dict,indent = 4,ensure_ascii=False)) |