python list按照字典元素的某个key的值排序

newlist = sorted(list_to_be_sorted, key=lambda k: k['name']) 

参考链接:https://stackoverflow.com/questions/72899/how-do-i-sort-a-list-of-dictionaries-by-a-value-of-the-dictionary

你可能感兴趣的:(Python)