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: #提前制定encoding f.write(ret) #print输出{"name": "杨林"},j.son也输出{"name": "杨林"}