例如:
activ.contributionGateway.serviceId=Service.ContributionGateway
activ.contributionGateway.url= google.com
activ.contributionGateway.connectionRetry.interval=5
activ.contributionGateway.connectionRetry.timeout=60
activ.contributionGateawy.FDG.PermissionId=6710
activ.contentGateway.serviceId=Service.ContentGateway
activ.contentGateway.url=google.com
activ.contentGateway.connectionRetry.interval=5
activ.contentGateway.connectionRetry.timeout=60
输出应该是这样的:
{
"Activ":{
"contributiongateway":{
"serviceId":"Service.ContributionGateway",
"url":"google.com",
"connectionRetry":{
"interval":5,
"timeout":60,
} "FDG":{
"PermissionId":6710,
}
} "contentGateway":{
"serviceId":"Service.ContentGateway",
"url":"google.com",
"connectionRetry":{
"interval":5,
"timeout":60
}
}
}
}
如何使用python来处理所有花括号以及所有子元素和新元素