import json d={"name":"孙悟空","age":18,"gender":"MALE"} f=open("d:/test.json","w",encoding='utf-8') json.dump(d,f) f.close()
为什么写入的文件中不是汉字,而是unicode?{"name": "u5b59u609fu7a7a", "age": 18, "gender": "MALE"}
拉丁的传说
相关分类