用xlrd读Excel

import xlrd
import os
xlsx = xlrd.open_workbook(r'D:\mycode\files\7月下旬入库表.xlsx')
# 用索引
table = xlsx.sheet_by_index(0)
# 用工作表名
# table = xlsx.sheet_by_name("7月下旬入库表")
# 读取第几行第几列
print(table.cell_value(1, 2))
print(table.cell(1,2).value)
print(table.row(1)[2].value)
posted @ 2020-12-31 15:25  干it的小张  阅读(126)  评论(0编辑  收藏  举报