Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python iterate directory

import os

directory = r'C:Usersadmin'
for filename in os.listdir(directory):
    if filename.endswith(".jpg") or filename.endswith(".png"):
        print(os.path.join(directory, filename))
    else:
        continue
Source by www.newbedev.com #
 
PREVIOUS NEXT
Tagged: #python #iterate #directory
ADD COMMENT
Topic
Name
5+4 =