数据json文件生成
2021-08-03 11:56
标签:color class 生成 abc indent int bsp open bcd ssa2 = location.read_locationa(row[4]) datajson["weather"]=ssa2[‘weather‘] datajson["temperature"]=ssa2[‘temperature‘] datajson["windpower"]=ssa2[‘windpower‘] datajson["status"]=abcd datajson["total"]=tuijian*100*0.6+ssa2[‘sum‘]*0.4 result = json.dumps(datajson, sort_keys=True, indent=2) with open(‘datajson.json‘,‘w‘,encoding=‘utf-8‘) as file: for i in result: file.write(i) print(i) print(‘数据已写入json文件...‘) 数据json文件生成标签:color class 生成 abc indent int bsp open bcd 原文地址:https://www.cnblogs.com/weidewozi/p/14910070.html