python dic 保存中文出现ascii码问题解决方案

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Eric_LH/article/details/83109732
dic={"商家名称": "井格老灶火锅(望京新世界店)", "评分": 26.2, "地址": "火锅望京广顺南大街路16号", "人均消费": 105, "评论数量": 1387} 
with open(filename+'.json','a') as outfile: 
   json.dump(dic,outfile,ensure_ascii=False) 
   outfile.write('\n')

python dic 保存中文出现ascii码问题解决方案,添加参数ensure_ascii=False就可以啦

猜你喜欢

转载自blog.csdn.net/Eric_LH/article/details/83109732
DIC