Skip to content

Instantly share code, notes, and snippets.

@boulama
Created February 3, 2023 05:47
Show Gist options
  • Save boulama/4b9674c629f62dd4152a2f02df0502d2 to your computer and use it in GitHub Desktop.
Save boulama/4b9674c629f62dd4152a2f02df0502d2 to your computer and use it in GitHub Desktop.
list all jpg images from folders recursively
def get_jpgs(path):
jpgs = []
for root, dirs, files in os.walk(path):
for file in files:
if file.endswith('.jpg'):
jpgs.append(os.path.join(root, file))
return jpgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment