I'm a newbie in python and trying to do some excel operations with python. My goal is to open multiple password protected excel files (.xls, and all in one folder) at once. They have the same password.
I managed to open one file with the below code. I'm struggling to find a way to open multiple files in one folder.
import msoffcrypto
import io
import pandas as pd
import xlrd
import glob
temp = io.BytesIO()
with open("/PATH/Filename.xls", 'rb') as f:
excel = msoffcrypto.OfficeFile(f)
excel.load_key('password')
excel.decrypt(temp)
df = pd.read_excel(temp)
del temp
print(df)