// 命令行 python 进入python环境
import xlwings as xw //测试是否安装成功
xw.__path__ // 查看安装目录
//用于批量修改Excel的脚本
#coding:utf-8
import xlwings as xw
app = xw.App(visible=True, add_book=False)
app.display_alerts=False
names = [''A,'B']
for index in range(len(names)):
FileName = "/Users/rhc/Desktop/XXX/"+names[index]+".xlsx"
wb = xw.Book(FileName.decode('utf8'))
sht = wb.sheets.active
str = "2017年9月"
sht.range('I2').value = str.decode('utf8')
wb.save()
wb.close()
app.quit()