我有这个泡沫回复
(reply){
return =
(return){
lineGroup[] =
(LLineGroup){
_uuid = "{4065AB99-B8AB-6B97-C930-AC3816346346}"
name = "Failover"
},
(LLineGroup){
_uuid = "{1EF78256-030D-31F6-B70F-60DF93143646}"
name = "Empfang"
},
}
}
据我了解,要获取 name 属性,您将使用如下内容:
print result.return.LLineGroup.name
但它包含“return”这个词,Python 说它是一个语法错误
我能做些什么?
其实我需要这样的东西:
for item in result['return'].lineGroup:
print item.name
谢谢约翰!