有没有办法使用 xlrd 关闭工作簿 [英] Is there a way to close a workbook using xlrd

查看:53
本文介绍了有没有办法使用 xlrd 关闭工作簿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用函数 open_workbook() 打开一个 excel 文件.但是我找不到稍后在 xlrd 模块中关闭文件的任何函数.有没有办法使用 xlrd 关闭 xls 文件?或者根本不需要?

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?

推荐答案

深入邮件列表存档,好像是构造函数直接关闭了文件对象,所以不需要显式关闭.

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.

这篇关于有没有办法使用 xlrd 关闭工作簿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆