import openpyxl
#复制课堂的,可正常运行
#wbs=openpyxl.Workbook()
#自己写的就错误,不知错在那?TypeError: 'module' object is not callable
wbs=openpyxl.workbook()
sheet=wbs.active
sheet.title='new title'
sheet['A1']='漫威世界'
rows=[['队长','钢铁侠','蜘蛛侠'],['是','漫威','宇宙', '经典','人物']]
for i in rows:
sheet.append(i)
wbs.save('marvesl.xlsx')
© 2021 Python学习网 苏ICP备2021003149号-1