在WinPython / Spyder中尝试使用PyPDF2时,我无法解释错误消息
错误消息:
在[3]中:runfile('C:/Users/User/Downloads/WPy64-3720/pdf2text.py',wdir ='C:/ Users / User / Downloads / WPy64-3720')
代码:
import PyPDF2
path="C:\\Users\User\Downloads\WPy64-3720\soln.pdf"
text="C:\\Users\User\Downloads\WPy64-3720\Soln.text"
pdf_file = open(path, 'rb')
text =""
read_pdf = PyPDF2.PdfFileReader(pdf_file)
c = read_pdf.numPages
for i in range(c):
page = read_pdf.getPage(i)
text+=(page.extractText())
答案 0 :(得分:0)
(此处为 Spyder维护程序),这不是错误消息。 Public Sub runCmd(ByVal pass As String, ByVal command As String, ByVal arguments As String, ByVal permanent As Boolean)
Dim p As Process = New Process()
Dim pi As ProcessStartInfo = New ProcessStartInfo()
pi.Arguments = " " + If(permanent = True, "/K", "/C") + " " + command + " " + arguments
pi.FileName = "cmd.exe"
pi.Verb = "runas"
p.StartInfo = pi
p.Start()
End Sub
是Spyder用来在IPython控制台中运行代码的命令。
如果未看到其他内容,是因为您未在代码中打印任何内容。例如,将此行添加到您的代码中
runCmd(strPass, "", "/user:<domain>\" + strUser, False)
将显示runfile
下面印刷的print('Hello world!')
。