Python读取excel数据

Posted Dsp Tian

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python读取excel数据相关的知识,希望对你有一定的参考价值。

‘‘‘python3读取excle数据‘‘‘
import xlrd
workbook = xlrd.open_workbook(rtest.xls, encoding_override=gbk)
print(workbook.sheet_names())

sheet = workbook.sheet_by_name(Sheet 1)
print(sheet.nrows, sheet.ncols)

for i in range(sheet.nrows):
    for j in range(sheet.ncols):
        print(sheet.cell(i, j).value, end= )
    print(\n)

 

以上是关于Python读取excel数据的主要内容,如果未能解决你的问题,请参考以下文章