openpyxl - load_workbook giving value error for string literal -
so writing simple test code in python, cant seem load workbook read , write into. workbook trying open has lot of data , linked access database. using python 2.7.
here code:
from openpyxl import workbook openpyxl import load_workbook print("here1") wb = load_workbook("z:\\pythonfiles\\testexcel2.xlsx") print("here2") ws1 = wb.get_sheet_by_name("output model") import datetime print("here3") ws1.cell(row=3, column=9).value="somevalue2" wb.save("z:\\pythonfiles\\testexcel2.xlsx")
now here error:
here1 traceback (most recent call last): file "z:\pythonfiles\test.py", line 4, in <module> wb = load_workbook("z:\\pythonfiles\\testexcel2.xlsx") file "c:\python27\openpyxl\reader\excel.py", line 233, in load_workbook parser.parse() file "c:\python27\openpyxl\reader\worksheet.py", line 104, in parse dispatcher[tag_name](element) file "c:\python27\openpyxl\reader\worksheet.py", line 235, in parse_row_dimensions self.parse_cell(cell) file "c:\python27\openpyxl\reader\worksheet.py", line 191, in parse_cell value = _cast_number(value) file "c:\python27\openpyxl\reader\worksheet.py", line 55, in _cast_number return int(value) valueerror: invalid literal int() base 10: '1e-3'
this bug in code has been fixed. https://bitbucket.org/openpyxl/openpyxl/commits/8cc875b206b08895a1a0ae9ac33cb997a941eddf
Comments
Post a Comment