import os
folder_path = "./folder-path"
for path, currentDirectory, files in os.walk(folder_path):
for file in files:
if not file.startswith("."):
print(os.path.join(path, file))
"""Examples from SO (see link)
Obviously the directory can be any directory with 'read access' (not only `os.curdir`)
Doc about the `os` module: https://docs.python.org/3/library/os.html
"""
# /! Return a `filter` object, not a `list`
import os
files_ex1 = filter(os.path.isfile, os.listdir(os.curdir))
# List comprehension
files_ex2 = [f for f in os.listdir(os.curdir) if os.path.isfile(f)]