from os import listdir all_files = listdir("./path/to/file") csv_files = list(filter(lambda f: f.endswith('.csv'), all_files))