how to get the file path I have a directory
C: / User / Production
It has several folders (10), which also have subfolders. I need to find the test.pdf file in one of the folders.
now my code can find the file only in the folders that are registered in folders.
My code
root = 'C:\\User\\Production'
folders = ['ONE','TWO','FREE','FOUR',......]
file = 'test.img'
folders_comtains_file = []
for folder in folders:
filepath = path.join(root,folder,file)
if path.isfile(filepath):
folders_comtains_file.append(filepath)
print(orderName)