这可能会重复,但现有的答案都没有解决我的问题.
This may be repeated, but none of the existing answers solved my problem.
所以,我使用的是 Python 2.7
,每次尝试时都会收到此错误(标题):
So, I'm using Python 2.7
, and I get this error (title) whenever I try this:
number = int(raw_input('Number : '))
我在 Sublime Text 2、compileronline.com 和 codecademy 中尝试过这个;它在此站点的前 2 个中失败.它适用于 codecademy 和终端编译器,但我不明白它失败的确切原因.
I tried this in Sublime Text 2, compileronline.com and in codecademy; it fails in the first 2 of this sites. It works on codecademy and in the terminal compiler, but I can't understand exactly why it is failing.
这里的问题是Sublime text 2的控制台不支持输入.
要解决此问题,您可以安装一个名为 SublimeREPL 的软件包.SublimeREPL 提供了一个接受输入的 Python 解释器.
To fix this issue, you can install a package called SublimeREPL. SublimeREPL provides a Python interpreter that takes in input.
而对于compileronline.com,您需要在网站右下方的STDIN Input"字段中提供输入.
And as for compileronline.com, you need to provide input in the "STDIN Input" field on the lower right of the website.
这篇关于Python:EOFError:读取一行时出现EOF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!