os.listdir(path)返回文件列表的顺序是任意的,不是很多博客中说的是按字母顺序排列的 大坑,谨记,FML file_names = os.listdir(data_path) file_names.sort()