Python list directory, subdirectory, and files
Use os.path.join to concatenate the directory and file name: for path, subdirs, files in os.walk(root): for name in files: print(os.path.join(path, name)) Note the usage of path and not root in the concatenation, since using root would be incorrect. In Python 3.4, the pathlib module was added for easier path manipulations. So the equivalent to os.path.join … Read more