Answers for "how to list all files in multiple directories python"

2

get all files within multiple directories python

from pathlib import Path
for f in Path().cwd().glob("../*.ext"):
    print(f)
    # do other stuff
Posted by: Guest on April-10-2020
1

get list of all files in folder and subfolders python

for path, subdirs, files in os.walk(root):
    for name in files:
        print os.path.join(path, name)
Posted by: Guest on December-07-2020

Code answers related to "how to list all files in multiple directories python"

Python Answers by Framework

Browse Popular Code Answers by Language