用python读取带密码的excel文件中的数据,python读取excel,用python读取带


用python读取带密码的excel文件中的数据,程序代码如下:#filename:readingxls.py‘‘‘此程序的作用为:用python读取带密码的excel文件中的数据。首先通过pip安装xlrd第三方库 pip3 install xlrd请输入excel文件路径:D:\x1.xls‘‘‘import xlrdpath=input("请输入excel文件路径:")workbook=xlrd.open_workbook(path)b=len(workbook.sheets())i=0for 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()

用python读取带密码的excel文件中的数据

评论关闭