简单的字典排序,根据value值得大小排序:
def sort_dict(dict_words): """ 字典排序 :param dict_words: :return: """ keys = dict_words.keys() values = dict_words.values() list_one = [(key, val) for key, val in zip(keys, values)] list_sort = sorted(list_one, key=lambda x: x[1], reverse=True) return list_sort