2021
06-09
06-09
解决python3 json数据包含中文的读写问题
python3默认的是UTF-8格式,但在在用dump写入的时候仍然要注意:如下importjsondata1={"TestId":"testcase001","Method":"post","Title":"登录测试","Desc":"登录基准测试","Url":"http://xxx.xxx.xxx.xx","InputArg":{"username":"王小丫","passwd":"123456",},"Result":{"errorno":"0"}}withopen('casedate.json','w',encoding='utf-8')asf:json.dump(data1,f,sort_keys=True,indent=4)...
继续阅读 >