4

I'm automating formula's using pythons XLWT library. I have column indexs, eg, 1,2,3,99, etc and would like to convert to A,B,C,D, AA,AB, etc.

Is there anything built into xlwt for this? Or should I just write my own function?

4

1 回答 1

7

您可以使用xlrds 辅助函数:

import xlrd
print xlrd.colname(56)
# BE

xlwt奇怪的是 - or中似乎没有直接等价物xlwt.Utils(尽管它确实具有用于转换单元格和名称的各种辅助函数)

按照问题的标题 - 您可以使用:

>>> xlwt.Utils.rowcol_to_cell(5, 2)
'C6'
于 2013-10-16T23:57:04.353 回答