xlrd library
- Install
xlrd
library from the command line:
pip install xlrd
- Read data from MS Excel (XLSX) file:
import xlrd
workbook = xlrd.open_workbook('test.xlsx')
sheet = workbook.sheet_by_index(0)
data = [[sheet.cell_value(r, c) for c in range(sheet.ncols)] for r in range(sheet.nrows)]
print(data)
Leave a Comment
Cancel reply