编程语言
首页 > 编程语言> > python json文件

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)
 

标签:dictData,文件,jsonfile,encoding,python,json,utf,data
来源: https://www.cnblogs.com/zhoug2020/p/13850738.html