import os from PIL import Image path = './input' file_list = os.listdir(path) for i in range(len(file_list)): print(file_list[i])
import os from PIL import Image path = './input' file_list = os.listdir(path) file_list.sort(key= lambda x:int(x[:-4]))#.png所以是[:-4] for i in range(len(file_list)): print(file_list[i])