import openpyxl
book = openpyxl.Workbook()
sh = book.active
sh.title = ‘工资表’
sh1 = book.create_sheet(‘年龄表-最后’)
sh2 = book.create_sheet(‘年龄表-最后后’)
sh3 = book.create_sheet(‘年龄表-最前’,0)
sh4 = book.create_sheet(‘年龄表-第二’,1)
sh[‘A1’] = ‘你好’
print(sh[‘A1’].value)
sh.cell(2, 2, value = ‘他好’)
print(sh.cell(2,2).value)
sh.cell(3,3).value = ‘我好’
print(sh.cell(3,3).value)
book.save(’/Users/xmtxmt/tmp/ex02.xlsx’)
版权归原作者 海量数据 工程师 所有, 如有侵权,请联系我们删除。