安装命令:pip3 install xlwt
常用设置:
# 创建一个workbook 设置编码 workbook = xlwt.Workbook(encoding = 'utf-8') # 创建一个worksheet worksheet = workbook.add_sheet('这里输入表单名称') # 写入excel # 参数对应 行, 列, 值 worksheet.write(1,0, label = 'this is test') # 保存 workbook.save('Excel_test.xls')
字体样式设置