Quote:
|
Originally Posted by Sane
Hey, it would be good to use os.walk if you don't know what folder the file is located in.
|
Oho! I didn't know about that particular function. So my previous search function could be very neatly reduced to a mere four lines:
def file_search(search_file, path):
for path, dirs, files in os.walk(path):
if search_file in files:
return os.path.join(path, search_file)