使用 xlsxwriter 重命名 Excel 工作表 [英] Rename Excel worksheet using xlsxwriter

查看:48
本文介绍了使用 xlsxwriter 重命名 Excel 工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 python 中使用 xlsxwriter 重命名 Excel 工作表.我在 linux 中使用 python 2.7 创建 excel 报告.但是找不到重命名标签的选项

How do i rename excel worksheet using xlsxwriter in python. I am using python 2.7 in linux to create excel reports. But cannot find an option to rename the tabs

推荐答案

您可以在添加工作表的同时通过 add_worksheet():

You can set the name of a worksheet while adding it via add_worksheet():

worksheet = workbook.add_worksheet('My Custom Name')

请注意您不能设置现有工作表的名称:

没有 set_name() 方法.设置工作表名称的唯一安全方法是通过 add_worksheet() 方法.

There is no set_name() method. The only safe way to set the worksheet name is via the add_worksheet() method.

这篇关于使用 xlsxwriter 重命名 Excel 工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆