Hi everyone I am trying to extract data from a list of spreadsheets on a folder using python with openpyxl and the os module. I retrieve the list of file, get the path from them and use it to load the workbook but each time the path trigger an error as each backslash is doubled, so if my file is on c:\Users\me\myfile it ends as C:\Users\me\myfile
here is the code I used
import os from openpyxl import Workbook,load_workbook
mydir = r'C:\Users\me\PycharmProjects\
for file in os.listdir(mydir):
if file.endswith('.xlsx'):
filepath = os.path.abspath(file)
wb = load_workbook(filepath, read_only=True)
print(wb.sheetnames)