@classmethod
def write_to_excel(cls, excel_name, sheet_name, row, col, content):
"""
写数据进excel
:param excel_name: 文件名 data.xls
:param sheet_name: sheet名称
:param row: 行
:param col: 列
:param content: 内容
:return:
"""
# 组装excel文件路径
file_path = adjust_path(test_case_path + '\\' + excel_name)
# 打开jira的xls文件
jira_rb = xlrd.open_workbook(file_path, formatting_info=True)
jira_wb = copy(jira_rb)
# 获取指定sheet页对象
jira_sheet = jira_wb.get_sheet(sheet_name)
# 写入内容
jira_sheet.write(row, col, content)
# 保存
jira_wb.save(file_path)
if __name__ == '__main__':
write_to_excel('scene_input.xls', '预定', 77, 0, '354345')
01-19
764
11-30
513
07-09
4083