1
如何获取此函数以仅返回值“Accounting”?如何返回特定的json字段?
def getowner():
z = [{u'_ref': u'network/ZG5zLm5ldHdvcmskMTAuMTAwLjEwMC4wLz90jLzA:10.100.100.0/24/default', u'extattrs': {u'Owner': {u'value': u'Accounting'}}}]
return ((h['value']) for h in z['Owner'])
z = getowner()
print z
即时得到错误TypeError: list indices must be integers, not str