📜  从 python 字典中提取特定键值 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:39.802000             🧑  作者: Mango

代码示例1
test_data = [{'id':1, 'value':'one'}, {'id':2, 'value':'two'}, {'id':3, 'value':'three'}]

generator = ( item['value'] for item in test_data )

...

for i in generator:
    do_something(i)