Created
February 3, 2023 05:47
-
-
Save boulama/4b9674c629f62dd4152a2f02df0502d2 to your computer and use it in GitHub Desktop.
list all jpg images from folders recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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