su wrote: > import os, os.path > import re > def core_finder(arg, dir, files): > for file in files: > path = os.path.join (dir, file) > if re.search("core.*", path): > print "found" > print path > > > os.path.walk('.', core_finder, 0)
Here's a simpler solution: import glob filenames = glob.glob( 'core*' ) In case you want the full path... import os filepaths = [os.path.join(os.getcwd(),f) for f in filenames] Regards Sreeram
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list