Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python for file in dir

## Using scandir
import os

directory = r'C:Usersadmin'
for entry in os.scandir(directory):
    if (entry.path.endswith(".jpg")
            or entry.path.endswith(".png")) and entry.is_file():
        print(entry.path)
 
PREVIOUS NEXT
Tagged: #python #file #dir
ADD COMMENT
Topic
Name
9+6 =