# coding: utf-8
"""
# @Time : 2020/7/25 7:58
# @Author : Gina Gao
# @File : 参与文档
https://www.cnblogs.com/tynam/p/11204895.html
# @Software: PyCharm
# @Descript:
"""
# import xlrd
#
# # 打开文件
# data = xlrd.open_workbook(r'C:\Users\HUAWEI\Desktop\投资要点批量入库.xlsx')
#
# # 查看工作表
# data.sheet_names()
# print("sheets:" + str(data.sheet_names()))
# #
import xlrd

def read_xlrd(excelFile):
data = xlrd.open_workbook(excelFile)
table = data.sheet_by_index(0)
dataFile = []
# print(table.nrows)
for rowNum in range(table.nrows):
# if 去掉表头
if rowNum >= 0:
dataFile.append(table.row_values(rowNum))
print(table.row_values(rowNum))
return dataFile

if __name__ == '__main__':
excelFile =r'C:\Users\HUAWEI\Desktop\投资要点批量入库.xlsx'
print(read_xlrd(excelFile=excelFile))

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-03-20
  • 2021-12-22
  • 2022-01-07
猜你喜欢
  • 2021-10-28
  • 2021-10-04
  • 2021-10-17
  • 2021-10-19
  • 2021-08-01
  • 2022-12-23
  • 2021-06-07
相关资源
相似解决方案