对象的列表元素我有对象的列表中的Python:查找具有明确的键值
accounts = [
{
'id': 1,
'title': 'Example Account 1'
},
{
'id': 2,
'title': 'Gow to get this one?'
},
{
'id': 3,
'title': 'Example Account 3'
},
]
我需要使用id = 2的对象。
当我只知道对象属性的值时,如何从此列表中选择适当的对象?
[查找列表中的对象的属性等于某个值(满足任何条件)]的可能的重复](http://stackoverflow.com/questions/7125467/find-object-in-list-that-has-attribute -equal-to-some-value-that-meets-any-condi) – 2014-08-27 13:17:46