2021
03-02
03-02
Python读写Excel表格的方法
本文实例为大家分享了Python读写Excel表格的具体代码,供大家参考,具体内容如下python读取Excel表格:importxlrddefread_excel():#打开文件wb=xlrd.open_workbook(r'test.xls')#获取所有sheet的名字print(wb.sheet_names())#获取第二个sheet的表名sheet2=wb.sheet_names()[1]print("sheet2={}".format(sheet2))#sheet1索引从0开始,得到sheet1表的句柄sheet1=wb.sheet_by_index(0)rowNum=sheet1.nrow...
继续阅读 >