python读写excel文件

xiaoxiao2021-02-28  150

#rw Excel file in python

import xlrd

path=input("Please input the path of the file:") workbook=xlrd.open_workbook(path) sheet=workbook.sheet_by_index(0) for row in range(sheet.nrows):     print()     for col in range(sheet.ncols):

        print("%7s"%sheet.row(row)[col].value,'\t',end='')

#转载自http://www.icourse163.org/learn/BIT-268001#/learn/content?type=detail&id=1002613059&cid=1002856176

转载请注明原文地址: https://www.6miu.com/read-18117.html

最新回复(0)