Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Created May 21, 2013 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fmasanori/5620333 to your computer and use it in GitHub Desktop.
Save fmasanori/5620333 to your computer and use it in GitHub Desktop.
Find Images Files on Hard Disck C
import fnmatch
import os
imagens = ['*.jpg', '*.jpeg', '*.png', '*.tif', '*.tiff']
achados = []
for raiz, diretórios, arquivos in os.walk("C:\\"):
for extensões in imagens:
for arq in fnmatch.filter(arquivos, extensões):
print (raiz + '\\' + arq)
achados.append(os.path.join(raiz, arq))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment