Python中glob.glob的排序问题
import glob
import numpy as np
import linecache
import os
path = 'E:\youyou\dataset_BUFC\DATASET_2\subject1\subject1'
filenames = glob.glob(path + "/*.png")
filenames2 = sorted(filenames, key=os.path.getmtime)
filenames3 = sorted(filenames,key=os.path.getsize)
for filename2 in filenames2:
print(filename2)