I seem to be stuck on some logic within my code and would appreciate any insight. My objective is to find an excel file in two different sub folders. The user inputs the ID number in the terminal (which is the name of the root folder) and create a file path with the ID. Now im not sure why my if statement isn't detecting the file in either folder.
If anyone can look at my code, it would be greatly appreciated.
#ask user to input the ID
ID = input("Please enter folder ID: ")
#path of excel directory and use glob
path = "/Users/one/Downloads/" + str(ID) + "/"
for (dir,subdirs,files) in os.walk(path):
if "Filey1_*.xlsx" in files:
print("File Found:", os.path.join(dir, "Filey1_*.xlsx"))
dir
as a variable because it is a built-in function.