import os subfolders = [ f.path for f in os.scandir(folder) if f.is_dir() ]
for path, subdirs, files in os.walk(root): for name in files: print os.path.join(path, name)