[python] xlrd

时间:2022-09-28 20:32:27

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 1: import xlrd module

line 3: open a xlsx file whose name is f

line4: open a sheet whose number is 0

line 5: get a specific value which is in (ROW_NO, COLUM_NO)