用python读取带密码的excel文件中的数据,程序代码如下:
 
#filename:readingxls.py
'''
此程序的作用为:用python读取带密码的excel文件中的数据。
首先通过pip安装xlrd第三方库 pip3 install xlrd
请输入excel文件路径:D:\x1.xls
'''
import xlrd
path=input("请输入excel文件路径:")
workbook=xlrd.open_workbook(path)
b=len(workbook.sheets())
i=0
for i in range(b):
    sheet=workbook.sheet_by_index(i)
    for row in range(sheet.nrows):
        print()
        for col in range(sheet.ncols):
            print("%7s"%sheet.row(row)[col].value,'\t',end='')
print()

相关文章:

  • 2021-08-02
  • 2021-08-08
  • 2022-02-07
  • 2021-06-09
  • 2021-12-13
  • 2021-10-19
猜你喜欢
  • 2022-02-07
  • 2021-11-14
  • 2021-12-05
  • 2022-12-23
  • 2021-11-16
  • 2021-11-30
相关资源
相似解决方案