如何在Python中关闭它?

2024-10-01 13:42:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要能够关闭PDF,但是我还没有弄清楚如何在PyPDF2中使用python2.7

我在下面打开它,然后尝试.close():

input1 = PdfFileReader(open(var_loopingpath+f,"rb"))

然后得到错误:

'PdfFileReader' object has no attribute 'close'

谢谢。在


Tags: nocloseobjectpdfvar错误attributeopen