본문 바로가기

app/python

python dict in list sort to dict value





from operator import itemgetter


temp_list = []

temp_dict = dict()

temp_dict["status"] = 1

temp_list.append(temp_dict)

temp_dict = dict()

temp_dict["status"] = 10

temp_list.append(temp_dict)

 sorted(temp_list, key=itemgetter('status'), reverse=True)