python:programmes:find
Ceci est une ancienne révision du document !
Chercher un fichier ou dossier
import os, fnmatch def locate(pattern, root=os.curdir): '''Locate all files matching supplied filename pattern in and below supplied root directory.''' for path, dirs, files in os.walk(os.path.abspath(root)): for filename in fnmatch.filter(files, pattern): yield os.path.join(path, filename)
python/programmes/find.1329337309.txt.gz · Dernière modification : 2012/02/15 20:21 de root