Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python iterate files

# import required module
import os
# assign directory
directory = 'files'
 
# iterate over files in
# that directory
for filename in os.listdir(directory):
    f = os.path.join(directory, filename)
    # checking if it is a file
    if os.path.isfile(f):
        print(f)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python #iterate #files
ADD COMMENT
Topic
Name
8+5 =