2024-04-19 06:39:14 发布
网友
如何在python中使用xlsxwriter重命名excel工作表。我在linux中使用Python2.7创建excel报表。但找不到重命名选项卡的选项
通过^{}添加工作表时,可以设置工作表的名称:
worksheet = workbook.add_worksheet('My Custom Name')
注意you cannot set the name of an existing worksheet:
There is no set_name() method. The only safe way to set the worksheet name is via the add_worksheet() method.
set_name()
add_worksheet()
不使用任何模块的另一种方法:
with open('example.xls', 'r') as f1, open('renamed.xls', 'w') as f2: f2.write(f1.read())
通过^{} 添加工作表时,可以设置工作表的名称:
注意you cannot set the name of an existing worksheet:
不使用任何模块的另一种方法:
相关问题 更多 >
编程相关推荐