Search This Blog

2023/10/01

Python: read xls

 import xlrd

book = xlrd.open_workbook("location.xls")

sh = book.sheet_by_index(0)

for rx in range(sh.nrows):
for col in range(sh.ncols):
print(sh.cell_value(rx, col) + ' ', end='')
print('\n',end='')

# pip install xlrd

No comments:

Post a Comment