I have a list of dictionaries and want each item to be sorted by a specific property values.
Take into consideration the array below,
[{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]
When sorted by name
, should become
[{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}]
转载于:https://stackoverflow.com/questions/72899/how-do-i-sort-a-list-of-dictionaries-by-a-value-of-the-dictionary