我正在尝试用python脚本编写一个JSON文件我有以下几点:
#write JSON file:
data = {
'description' : 'ACME',
'taskType' : 100,
'scanFileTypes' : 542.23,
'connections' : connectionName,
'fileTypeExclude' : False,
'policies': 'PCI_Hadoop'
}
with open(jsonPropPath, 'w') as outfile:
json.dump(data, outfile, ensure_ascii=False)
我的JSON文件如下所示:
cat/home/matt/DGagent/jsonFile_.json目录
{"description": "ACME", "scanFileTypes": 542.23000000000002, "connections": "dgcl_20150805102636", "policies": "PCI_Hadoop", "taskType": 100, "fileTypeExclude": false}[matt@server1 ~]
正如您所看到的,小数点正在扩展,它还添加了服务器:[马特@服务器1~]
有人能帮我纠正这些问题吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐