#-*-coding:utf8-*-

import xlrd

 

#代开excel文件读取数据

data = xlrd.open_workbook("C:\\Users\\hyl\\Desktop\\1.xls")

 

#通过索引顺序获取一个工作表

table = data.sheet_by_index(0)

 

#获取整行的值(数组) table.row_values(i)

#获取行数

nrows = table.nrows

 

for i in range(nrows):

print table.row_values(i)

 

print table.cell(0,0).value #输出单元格

posted on 2016-10-27 11:44  Google-boy  阅读(241)  评论(0编辑  收藏  举报