Are xlrd and xlwt compatible?

Posted by Leo on Stack Overflow See other posts from Stack Overflow or by Leo
Published on 2012-09-23T11:33:41Z Indexed on 2012/09/23 15:37 UTC
Read the original article Hit count: 467

Filed under:
|
|
|

I'm trying to create a workbook with python and I need to test the values of different cells to fill it but I'm having some troubles. I use xlrd and xlwt to create and edit the excel file.

I've made a little example of my problem and I don't understand why it's not working.

import xlwt
import xlrd
wb = xlwt.Workbook()
ws = wb.add_sheet('Test')
ws.write(0,0,"ah")
cell = ws.cell(0,0) # AttributeError: 'Worksheet' object has no attribute 'cell'
print cell.value

I had taken for granted that xlrd and xlwt have shared classes which can interact with each other but it doesn't seem to be the case. How do I get the cell value of an open Worksheet object?

© Stack Overflow or respective owner

Related posts about python

Related posts about excel