基础: 新换的系统,刚安装了python,vscode ,vscode中的python插件.
安装: pip install xlwings
示例:
import xlwings as xw app = xw.App(visible=True,add_book=False) wbook01 = xw.Book('tst1.xlsx') wbook02 = xw.Book('tst2.xlsx') for sheet in wbook02.sheets: sheet.copy(after=wbook01.sheets[-1]) wbook01.save()
wbook01.close()
app.quit()
实现了tst2工作簿中内容按顺序复制到tst1中,便于整理。
存在的情况: 系统安装的是WPS app.quit() app.kill()都不能主动关闭应用。
参考自这位同学:https://blog.csdn.net/qfxietian/article/details/123822358
标签:python,app,xlwings,excel,wbook01,vscode,xw From: https://www.cnblogs.com/liuxue4503/p/16786715.html