赞
踩
目录
3.4 .insert_cols()和.insert_row():插入空行和空列
3.5 .delete_rows()和.delete_cols():删除行和列
3.7 .create_sheet():创建新的sheet表格
3.9 .copy_worksheet():复制一个sheet表到另外一张excel表
3.13 sheet.auto_filter.ref:给表格添加"筛选器"
- import openpyxl
- from openpyxl import Workbook
- from datetime import datetime
-
- time_1_struct= time.strftime("%Y-%m-%d_%H_%M_%S",time.localtime())
- def CreatExcel():
- global time_1_struct
- global wb
-
- wb = Workbook()
- sheetName = wb.create_sheet("WiFi_OnOff_v1-result_log",0)
- report_title = ['LocationTime', 'Runtimes', 'results', 'OpenFailTimes', 'CloseFailTimes']
- sheetName.append(report_title) # 写入表头
- wb.save("{}_WiFi_OnOff_v1-result_log.xlsx".format(time_1_struct)) #创建excel名称并保存
-
-
- #向Excel中写数据
- def WriteDstaToExcel(num,LocationTime, Runtimes, results, OpenFailTimes, CloseFailTimes):
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。