import xlrd,xlwt,xlutils
self.data = xlrd.open_workbook(file,formatting_info = True) #打開文件
sheet1 = self.data.sheet_by_name('功能用例模板')
writeOpenxlsx = copy(self.data) #複製excel內容和修改文件
#獲取表格列內容
tag = sheet1.col_values(6)
#修改表格內容
writexlsxSheet = writeOpenxlsx.get_sheet('功能用例模板')
style1 = xlwt.easyxf(font:height 240, color-index red, bold on;align: wrap on, vert centre, horiz center;border: left thin,right thin,top thin,bottom thin) #表格格式:加上邊框
writexlsxSheet.write(i,11,res,style1) #將結果寫入第11列,表格格式爲style1
#保存
writeOpenxlsx.save(file)