lundi 30 mars 2015

data only in openpyxl not working in linux

hi i am working in pycharm. Using openpyxl i want to parse all the cell value one by one. using pycharm in windows with the below code, im having no trouble, but when i tried to run it in linux i encountered an issue.


here is my code:



import openpyxl

workbook = openpyxl.load_workbook(filename='sample.xlsx', use_iterators=True, data_only=True)
worksheet = workbook.get_sheet_by_name('sample1')
for row in worksheet.rows:
for cell in row:
print cell.value


this code works fine in pycharm windows. here is the error when i try to run this in linux:



Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: load_workbook() got an unexpected keyword argument 'data_only'


I need data_only = True command because some of my cell in my file is written in formula and I want to get only the data.


Aucun commentaire:

Enregistrer un commentaire