时间:2021-07-01 10:21:17 帮助过:170人阅读
实例如下所:
import os import xlrd import xlwt from xlutils.copy import copy def excelwrite(L=None): if L is None: L = [] print(L) filename = r'wldata.xls' workbook = xlrd.open_workbook(filename, formatting_info=True) sheet = workbook.sheet_by_index(0) rowNum = sheet.nrows colNum = sheet.ncols newbook = copy(workbook) newsheet = newbook.get_sheet(0) # 在末尾增加新行 str = 'hehe' newsheet.write(rowNum, 0, str) # 覆盖保存 newbook.save(filename)
相关推荐:
Python实现的根据文件名查找数据文件功能示例
以上就是python 实现在Excel末尾增加新行的详细内容,更多请关注Gxl网其它相关文章!