python xlrd操作excel

import xlrd

data=xlrd.open_workbook('C:/Users/xumingxun/Desktop/xlrd-0.9.3/abc.xls')

table=data.sheets()[0]

table=data.sheet_by_index(0)

col=table.ncols

print(col)

for i in range(0,col):

    col=table.col(i)

    row=len(col)

    for j in range(0,row):

        if(col[j].value!=''):

            print(col[j].value)

  

posted @ 2014-05-23 00:52  otwos  阅读(183)  评论(0编辑  收藏  举报