在Spyder中,runfile的含义是什么 [英] What's the meaning of runfile in Spyder

查看:9
本文介绍了在Spyder中,runfile的含义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在WinPython/Spyder中使用PyPDF2时无法解释错误消息

错误消息:

在[3]中:runfile(‘C:/Users/User/Downloads/WPy64-3720/pdf2text.py’,wdir=‘C:/Users/User/Downloads/WPy64-3720’)

编码:

import PyPDF2
path="C:\UsersUserDownloadsWPy64-3720soln.pdf"
text="C:\UsersUserDownloadsWPy64-3720Soln.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()) 

Spyder

(推荐答案Maintainer Here)这不是错误消息。runfile是Spyder用来在IPython控制台中运行代码的命令。

如果您没有看到任何其他内容,则是因为您没有在代码中打印任何内容。例如,将此行添加到您的代码

print('Hello world!')

将在下面runfile显示Hello world

这篇关于在Spyder中,runfile的含义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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