获取文件夹内所有文件名,过滤指定格式扩展名的文件 def get_files() -> list: file_list = os.listdir('.') ## 获取当前文件夹内所有文件名 for file in file_list[::-