import xlrd
EXCEL_BOOK_FULLNAME='FULL FILE NAME'
workbook=xlrd.open_workbook(EXCEL_BOOK_FULLNAME)
worksheet=workbook.sheet_by_name('Sheet1')
rows=worksheet.nrows #worksheet rows
cols=worksheet.ncols #worksheet columns
lists=[[],[],[],[]] #modify this according your column counts
for c in range(cols): #transfer excel values into lists
for r in range(rows):
lists[c].append(worksheet.cell_value(r,c))
追问请问导入xlrd需要加入什么包吗?
workbook=xlrd.open_workbook(EXCEL_BOOK_FULLNAME)
这句话运行不了
本回答被网友采纳