Answers for "python getting files of a partifular directory"

12

get files in directory python

import os
files_and_directories = os.listdir("path/to/directory")
Posted by: Guest on June-12-2020
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

Code answers related to "python getting files of a partifular directory"

Python Answers by Framework

Browse Popular Code Answers by Language