def excel_init(module_name): excel.excel_fd = zexcel.excel_init() sheet_name = test.name + " " + module_name + "测试结果" excel.sheet_fd = zexcel.sheet_init(excel.excel_fd, sheet_name) # 写设备信息 excel.sheet_fd.write(zexcel.PROJECT_ROW, zexcel.PROJECT_COL + 1, test.project, style=zexcel.set_style(zexcel.BLACK, 260, bold=True, align='', pattern_color='light_orange')) excel.sheet_fd.write(zexcel.VERSION_ROW, zexcel.VERSION_COL + 1, test.version, style=zexcel.set_style(zexcel.BLACK, 260, bold=True, align='', pattern_color='light_orange')) excel.sheet_fd.write(zexcel.MAC_ROW, zexcel.MAC_COL + 1, test.mac, style=zexcel.set_style(zexcel.BLACK, 260, bold=True, align='', pattern_color='light_orange')) excel.sheet_fd.write(zexcel.DATE_ROW, zexcel.DATE_COL + 1, test.date, style=zexcel.set_style(zexcel.BLACK, 260, bold=True, align='', pattern_color='light_orange')) filename = os.path.join( os.path.dirname(__file__) + "./../results/" + test.output_file + ".xls") excel.excel_fd.save(filename) # 保存xls # 从第二行开始写入 excel.row_point = 1
def excel_init(): excel.excel_fd = zexcel.excel_init() excel.sheet_fd = zexcel.sheet_init(excel.excel_fd, "WIFI测试结果") # 从第二行开始写入 excel.row_point = 1