python - 使用 xlwt python 合并两个以上单元格

标签 python excel numpy xlwt

我正在尝试合并 Excel 文件的一行中的 4 列。此链接提供了有关如何对两行执行此操作的一些建议:How to write a cell with multiple columns in xlwt? 它用来合并两列和两行的行:

sheet.write_merge(0, 0, 0, 1, 'Long Cell')

但是,当我尝试仅合并 4 行时,相同的代码语法不起作用。我的代码:

sh.write_merge(0,4,0,5,0,6,0,7,'Start point\nCo-ordinates')

我基本上需要类似 this. 的东西

最佳答案

也许是这个?

sh.write_merge(0, 0, 4, 7, 'Start point\nCo-ordinates')

关于python - 使用 xlwt python 合并两个以上单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53692241/

相关文章:

python - 如何让我的 Python Discord 机器人检查消息是否由机器人本身发送?

excel - 我可以从 32 位版本的 Excel VBA 调用 64 位 DLL 吗?

excel - 引用工作表中框架中的控件

python - 如何使用索引找到整个二维数组中的最大值

python - NumPy 的/科学的 : Making one series converge towards another after a period of time

python - 在两个属性中拆分类属性

python - pip install re2 报错

java - 使用 Apache POI 将填充颜色和边框应用到 Excel 范围

python - PyArray_SimpleNewFromData 示例

python - Python 中的 SQL 查询,其中值可能为 None/Null