摘要: 1.读取 第一种: 第二种:字典方式读取 2.写入 第一种: 第二种: 阅读全文
posted @ 2018-08-18 18:04 从此重新定义啦 阅读(4753) 评论(0) 推荐(0) 编辑
摘要: import json dic={ "name":"杨林" } ret=json.dumps(dic,ensure_ascii=False) #因为json.dumps 序列化时对中文默认使用的ascii编码.想输出真正的中文需要指定ensure_ascii=False print(ret) with open("j.son","w",encoding="utf-8") as f: ... 阅读全文
posted @ 2018-08-18 00:00 从此重新定义啦 阅读(272) 评论(0) 推荐(0) 编辑