Suppose there is a directory DIR1 form C:\\Users\\Admin . There is also a list that looks something like this: ['f1', 'f2', 'f3', 'f4', 'f5'] , and the file name: FILE1 . The list represents possible folder names at DIR1 .
What is the fastest way to find all files with the name FILE1 , if it can be located only along the path DIR1\<f1-f5> , one or two levels deeper? That is, possible addresses can be approximately like this: DIR1\f2\FILE1 DIR1\f4\any_folder\FILE1 , DIR1\f4\any_folder\FILE1 DIR1\f4\qwe\asd\FILE1 , DIR1\f4\qwe\asd\FILE1 .
I tried to experiment with os.walk , glob , pathlib , etc., but it’s not very pathlib to determine for myself, and I hardly ever used all possible methods ...