Answers for "python scan folder for files"

5

how to search for a specific file extension with python

import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
    print(file)
Posted by: Guest on March-06-2020
12

get files in directory python

import os
files_and_directories = os.listdir("path/to/directory")
Posted by: Guest on June-12-2020

Code answers related to "python scan folder for files"

Python Answers by Framework

Browse Popular Code Answers by Language