# 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))