1. 对字典按value排序
sorted(d.items(),key = lambda x:x[1],reverse = True)
2. 模糊搜索路径
from glob import glob lists = glob(r‘./*.txt‘) #return all txt file
1. 对字典按value排序
sorted(d.items(),key = lambda x:x[1],reverse = True)
2. 模糊搜索路径
from glob import glob lists = glob(r‘./*.txt‘) #return all txt file
原文:https://www.cnblogs.com/dxs959229640/p/8618775.html