I created a function to read excel sheet read_Excel_file(path) that return a list contains some data from a specific Column.
and in the main code I search all the excel files (where the name start Design) and this excel file should be saved in a folder Design
. If I find the excel file, I call the function read_Excel_file
.
Please find below the code:
import openpyxl as opx
import os
for r, d, f in os.walk('.'):
for file in f:
if '.xlsx' and 'design' in file:
#print(r)
if r.endswith('\Design'):
print(file)
read_Excel_file(file)
but I get the error :
No such file or directory
even if I am sure that I have this file in my directory
Do you think that I have path problem?
PS: I add print(file)
just to check the name of the file, but when read_Excel_file(file)
after that I have the error.
Can you help me please?