开发者

write array starting from specific column to new workbook using xlwt

I am trying to write an array (d开发者_开发问答ata = [][]) to a worksheet I will create using xlwt. My question is can I specify a column to start from? I am planning to use a for loop to iterate through the array retrieving the values row by row starting a new line with each row ex: first row starts at C1, next row starts at C2 etc... I have read the documentation and examples but cannot find a clear way to do this. Any help would be greatly appreciated!


Something like:

wb = xlwt.Workbook()
ws = wb.add_sheet('Sheet1')
for r, row in enumerate(data):
    for c, col in enumerate(row):
        ws.write(r, 2 + c, label=col)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜