TypeError:int()在ironpython中获得pyPdf1.15的意外关键字参数“base”错误

2024-10-01 22:43:30 发布

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

当我打开终端并键入这些代码时,我已经成功地安装了pyPDF2pyPdf-1.15

import os
from PyPDF2 import PdfFileReader
path = "F:/Download"
inputFileName = os.path.join(path, "RealPython.pdf")
inputFile = PdfFileReader(open(inputFileName, "rb"))

然后这个就来了

^{pr2}$

我不知道我做错了什么,有什么帮助吗?在


Tags: path代码fromimport终端键入pdfos
1条回答
网友
1楼 · 发布于 2024-10-01 22:43:30

错误:int() got an unexpected keyword argument 'base'。这很可能与ironpython int函数实现有关。您可以尝试在PyPDF2包中编辑这个文件:C:\Program Files (x86)\IronPython 2.7\lib\site-packages\PyPDF2\generic.py(readHexStringFromStream中的第302行)。将16作为第二个位置参数传递给int:

#txt += chr(int(x, base=16))
txt += chr(int(x, 16))

相关问题 更多 >

    热门问题