Openpyxl循环不写在Excel表上

时间:2018-07-18 17:26:31

标签: python python-3.x openpyxl

我正在编写一个快速脚本,用TEST填充第9-19列,但是当我运行该程序时,它不会显示任何输出。

import openpyxl
from openpyxl import workbook
path = "C:/Users/FOO/Desktop/Path_E/FOO.xlsx"
wb = openpyxl.load_workbook(path)
sheet_read = wb.get_sheet_by_name("FOO")
sheet_write = wb.active


for i in range(9, 20):
   sheet_write.cell(row = 7, column = i).value = 'TEST'


wb.save(path)

0 个答案:

没有答案