python json文件

def loadJson(jsonfile):
with open(jsonfile, 'r', encoding='utf-8') as f:
dictData = json.load(f)
return dictData

def saveJson(jsonfile, data):
with open(jsonfile, "w", encoding='utf-8') as f:
json.dump(data, f, indent=4)
 
posted on 2020-10-21 09:57  莫水千流  阅读(126)  评论(0)    收藏  举报