the current directory that mention the string popenfind -name "py-print -exec fgrep popen {\if you happen to have unix-like find command on every machine you will ever usethis is one way to process directories rolling your own find module but if you don' happen to have unix find on all your computersnot to worry--it' easy to code portable one in python python itself used to have find module in its standard librarywhich used frequently in the past although that module was removed between the second and third editions of this bookthe newer os walk makes writing your own simple rather than lamenting the demise of modulei decided to spend minutes coding custom equivalent example - implements find utility in pythonwhich collects all matching filenames in directory tree unlike glob globits find find automatically matches through an entire tree and unlike the tree walk structure of os walkwe can treat find find results as simple linear group example - pp \tools\find py #!/usr/bin/python ""###############################################################################return all files matching filename pattern at and below root directorycustom version of the now deprecated find module in the standard libraryimport as "pp tools find"like originalbut uses os walk loophas no support for pruning subdirsand is runnable as top-level scriptfind(is generator that uses the os walk(generator to yield just matching filenamesuse findlist(to force results list generation###############################################################################""import fnmatchos def find(patternstartdir=os curdir)for (thisdirsubsherefilesherein os walk(startdir)for name in subshere fileshereif fnmatch fnmatch(namepattern)fullpath os path join(thisdirnameyield fullpath def findlist(patternstartdir=os curdirdosort=false)matches list(find(patternstartdir)if dosortmatches sort(return matches searching directory trees