Read .xls file

0

I have a problem reading a .xls file using Python with Flask.

My code:

from openpyxl import load_workbook

wb = load_workbook(filename=settings.MEDIA_ROOT + '/xls/arquivo.xls', read_only=True)
    ws = wb['Tab 1']

    for row in ws.get_squared_range(min_col=2,max_col=34, min_row=2, max_row=61):
        for cell in row:
            print(cell.value)

The error you get is:

  

NameError: name 'settings' is not defined

    
asked by anonymous 04.10.2017 / 04:30

0 answers