python解密excel加密文件

pip install msoffcrypto
import msoffcrypto
#读取 文件
file = msoffcrypto.OfficeFile(open("/Users/liangchen/django/excel/pwd.xlsx", “rb”))

file.load_key(password=“hpAAhuM8”)

print(file.dict)
file.decrypt(open(’/Users/liangchen/django/excel/pwd2.xlsx’, ‘wb’)) #生成新的不带密码的文件

https://blog.csdn.net/sinat_38282498/article/details/102857973

你可能感兴趣的:(python解密excel加密文件)