I read 150 excel files in a loop, opening them with xlrd.open_workbook()
, which returns a Book
object. At the end, when I tried to umount
In case you open a workbook with on_demand = True
for a more economic resource use (see here how does it work), you need to call release_resources()
method at the end. As a minimal example:
import xlrd
book = xlrd.open_workbook('workbook.xls', on_demand = True)
sheet = book.sheet_by_index(0)
data = [[str(c.value) for c in sheet.row(i)] for i in xrange(sheet.nrows)]
book.release_resources()
del book