Python模块之xlrd - 读取excel的xls文件

xlrd

作用:

   Excle内容读取

必要操作:

import xlrd

帮助查看:

>>> help(xlrd)
或 单独查看某个方法(函数)
>>> help(xlrd.open_workbook)

方法(函数):

  ## 打开test.xls文件

wb = xlrd.open_workbook('test.xls')

  ## 读取第1个索引的sheet页,索引0开始

sheet = wb.sheet_by_index(1)

  ## 读取excle里第一个sheet页,第10列(J列)内容,索引0开始

col = sheet.col_values(9)

  

 
 
 
 
-
xlrd
posted @ 2022-01-11 22:22  悟透  阅读(184)  评论(0编辑  收藏  举报