Is there a way to close a workbook using xlrd

Sumod picture Sumod · Mar 23, 2011 · Viewed 21.5k times · Source

I am using the function open_workbook() to open an excel file. But I cannot find any function to close the file later in the xlrd module. Is there a way to close the xls file using xlrd? Or is not required at all?

Answer

Andrea Spadaccini picture Andrea Spadaccini · Mar 23, 2011

Digging into the mailing list archive, it seems that the file object is closed directly by the constructor, so you don't need to close it explicitly.