0.xlrd introduce Library for developers to extract data from Microsoft Excel (tm) spreadsheet files 1. install xlrd 2. use xlrd in python import xlrd book = xlrd.open_workbook(f) sheet = book.sheet_by_index(0) sheet.cell(ROW_NO, COLUM_NO).value line…
import xlrd data = xlrd.open_workbook(EXCEL_PATH) table = data.sheet_by_index(0) lines = table.nrows cols = table.ncols print u'The total line is %s, cols is %s'%(lines, cols) # 读取某个单元格 table.cell(x, y).value ''' x : 行 y : 列 行/列都是从0开始 ''' In [1]: imp…