python excel表格操作

(1)xlwings基础语法介绍

(2)excel操作实例


先上例子:

import xlwings as xw
file_path = "E:\\党支部\\大三上\\20151201_转预备_评估表_汇总\\林文超评分.xlsx"
app=xw.App(visible=False,add_book=False)
app.display_alerts=False
app.screen_updating=False
wb=app.books.open(file_path)
work_detail = wb.sheets[0].range('A1:D2').value
print(work_detail)
#关闭打开的excel
wb.close()


file_path = "E:\\党支部\\大三上\\20151201_转预备_评估表_汇总\\林文超评分2.xlsx"
wb_tartget = app.books.open(file_path);
wb_tartget.sheets[0].range('A1').value = work_detail
print(wb_tartget.sheets[0].range('A1:D2').value)
app.quit();

你可能感兴趣的:(python)