python读取excel表格

 

# -*- coding:utf-8 -*-
import xlrd

path = u"C:\\读取表格\\表格.xls"#
workbook = xlrd.open_workbook(path)
sheet = workbook.sheet_by_index(0)
for row in range(sheet.nrows):
    for col in range(sheet.ncols):
        print(sheet.row(row)[col].value)#按行读取excel

 

posted @ 2019-05-14 18:42  努力奋斗小青年  阅读(152)  评论(0编辑  收藏  举报