Is there a way to close a workbook using xlrd

早过忘川 提交于 2019-11-30 00:23:49

问题


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?


回答1:


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.




回答2:


The open_workbook calls the release_resources ( which closes the mmaped file ) before returning.



来源:https://stackoverflow.com/questions/5403781/is-there-a-way-to-close-a-workbook-using-xlrd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!