Skip to content

Instantly share code, notes, and snippets.

@boulama
Last active November 23, 2023 21:17
Show Gist options
  • Save boulama/f1f8af10c6f419cfe40e217d6d6d6184 to your computer and use it in GitHub Desktop.
Save boulama/f1f8af10c6f419cfe40e217d6d6d6184 to your computer and use it in GitHub Desktop.
Loop through a given folder and return all image files from that folder
image_files = [f for f in os.listdir(input_folder) if f.lower().endswith(('.png', '.jpg', '.jpeg', '.gif', '.bmp'))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment