python 读取 xlsx

import xlrd
csv_path = "download/07_CHN.xlsx"
        workbook=xlrd.open_workbook(csv_path)
        worksheet=workbook.sheet_by_index(0)
        name=worksheet.name  #获取表的姓名
        nrows=worksheet.nrows  #获取该表总行数
        ncols=worksheet.ncols  #获取该表总列数

        for i in range(nrows): #循环打印每一行
              if i > 0 :
                row = worksheet.row_values(i)

                Stage = row[0]
                WordID = row[1]

 

posted @ 2019-11-06 17:48  黑色白沙  阅读(620)  评论(0编辑  收藏  举报