Answers for "for each image in folder python"

17

how to iterate through images in a folder python

import os
directory = 'the/directory/you/want/to/use'

for filename in os.listdir(directory):
    if filename.endswith(".txt"):
      #do smth
      continue
    else:
    continue
Posted by: Guest on March-30-2020
2

python get all images in directory

import glob

for filename in glob.iglob(root_dir + '**/*.jpg', recursive=True):
    # Do something
Posted by: Guest on December-22-2020

Code answers related to "for each image in folder python"

Python Answers by Framework

Browse Popular Code Answers by Language