let' do another file search example in the last sectionwe implemented version of the unix grep command this timelet' do simple version of the find command the example will search the entire filesystem for paths that contain given string of charactersfrom concurrent futures import threadpoolexecutor from pathlib import path from os path import sep as pathsep from collections import deque def find_files(pathquery_string)subdirs [for in path iterdir()full_path str( absolute()if is_dir(and not is_symlink()subdirs append(pif query_string in full_pathprint(full_pathreturn subdirs query pyfutures deque(basedir path(pathsepabsolute(with threadpoolexecutor(max_workers= as executorfutures appendexecutor submit(find_filesbasedirquery)while futuresfuture futures popleft(if future exception()continue elif future done()subdirs future result(for subdir in subdirsfutures append(executor submitfind_filessubdirquery)elsefutures append(future