import json
x = {key1:value1,
key2:value2,
key3:value3}
#把python编码成json放在那个文件里
filename = 'pi_x.txt'
with open (filename,'w') as f:
#换行存取,可视化效果好
json.dump(x,f,indent=4)
dict导入json文件中
最新推荐文章于 2024-11-07 17:56:25 发布