1 import xlwings as xw
2 app = xw.App(visible = False)
3 workbook = app.books.add()
4 worksheet = workbook.sheets.add('產品統計表')
5 worksheet.range('A1').value = '編號'
6 workbook.save(r'd:\北京.xlsx')
7 workbook.close()
8 app.quit()
1 import xlwings as xw
2 app = xw.App(visible = False)
3 workbook = app.books.add()
4 worksheet = workbook.sheets.add('產品統計表')
5 worksheet.range('A1').value = '編號'
6 workbook.save(r'd:\北京.xlsx')
7 workbook.close()
8 app.quit()