Nov-05-2018, 07:40 AM
You can use glob module.
You could just pass a list of extensions and glob will do the rest.
You could just pass a list of extensions and glob will do the rest.
import glob img_files = [] for idx, img_ext in enumerate(["*.jpeg", "*.jpg", "*.JPG"]): img_files.extend(glob.glob(img_ext))