可乐博客

Python自定义排序

from functools import cmp_to_key
def cmp(s1, s2):
    return s1<s2

sorted(path_list, key=cmp_to_key(cmp))
随笔