excel
来源:互联网 发布:人力资源系统 源码 编辑:程序博客网 时间:2024/05/17 16:11
#coding=utf-8
import xlwt
import time
today = time.strftime('%Y-%m-%d')
def test_report():
########################1。创建excel文件,定义编码格式########################
workbook = xlwt.Workbook(encoding='utf-8')
#########################2。添加worksheet,可自定义名字########################
sheet_summary = workbook.add_sheet('测试概况')
sheet_detail = workbook.add_sheet('测试详情')
#########################.3。指定行列写入数值(行,列,值),下标从0开始########################
###3.1).测试概要 -- 标题
sheet_summary.write(0,0,'测试时间')
sheet_summary.write(1,0,'用例总数')
sheet_summary.write(2,0,'成功总数')
sheet_summary.write(3,0,'失败总数')
###3.2).测试概要 -- 内容
sheet_summary.write(0,1,today)
sheet_summary.write(1,1,100)
sheet_summary.write(2,1,70)
sheet_summary.write(3,1,30)
workbook.save('test.xls')
test = test_report()
import xlwt
import time
today = time.strftime('%Y-%m-%d')
def test_report():
########################1。创建excel文件,定义编码格式########################
workbook = xlwt.Workbook(encoding='utf-8')
#########################2。添加worksheet,可自定义名字########################
sheet_summary = workbook.add_sheet('测试概况')
sheet_detail = workbook.add_sheet('测试详情')
#########################.3。指定行列写入数值(行,列,值),下标从0开始########################
###3.1).测试概要 -- 标题
sheet_summary.write(0,0,'测试时间')
sheet_summary.write(1,0,'用例总数')
sheet_summary.write(2,0,'成功总数')
sheet_summary.write(3,0,'失败总数')
###3.2).测试概要 -- 内容
sheet_summary.write(0,1,today)
sheet_summary.write(1,1,100)
sheet_summary.write(2,1,70)
sheet_summary.write(3,1,30)
workbook.save('test.xls')
test = test_report()
阅读全文
0 0
- Excel
- Excel
- ExCel
- excel
- Excel
- EXCEL
- excel
- excel
- EXCEL
- Excel
- excel
- Excel
- excel
- excel
- excel
- EXCEL
- excel
- excel
- Xcode9配置Git操作
- 1.3多媒体存储技术
- Android 项目混淆
- ubuntu 16.04 安装docker、docker-compose
- HDU 6185Covering(矩阵快速幂)
- excel
- centos-6.5-x64搭建hadoop集群
- jdk1.7DualPivotQuicksort
- selenium 各版本简介及相关特性
- 计蒜客 16956 Query on a string(2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 G)
- 欢迎使用CSDN-markdown编辑器
- HTML-后台管理模版
- poj1018 Communication System
- jquery插件的封装以及类的扩展