read excel files with python and xlrd

#coding=utf-8
#!/usr/bin/python
import xlrd

data = xlrd.open_workbook('160321.xls')
table = data.sheets()[0]
a=table.col_values(3)
print(a[1])
print(a[2])
b=float(a[1])+float(a[2])
print(b)
print(table.nrows)
print(table.row(1)[3].value)

猜你喜欢

转载自blog.csdn.net/llrraa2010/article/details/50995244