Python:EOFError:EOF当读取一行时 [英] Python: EOFError: EOF when reading a line

查看:674
本文介绍了Python:EOFError:EOF当读取一行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能会重复,但现有的答案都没有解决我的问题。



因此,我使用 Python 2.7 ,我得到这个错误(标题)每当我尝试这样:

  number = int(raw_input :'))



我在Sublime Text 2,compileronline.com和codecademy它在这个网站的前2个失败。它工作在codecademy和终端编译器,但我不能明白为什么它是失败。

解决方案

这里的问题是Sublime text 2的控制台不支持输入。 p>

要解决此问题,您可以安装名为 SublimeREPL 的软件包。 SublimeREPL提供了一个接受输入的Python解释器。



对于compileronline.com,您需要在右下角的STDIN输入字段中提供输入网站。


This may be repeated, but none of the existing answers solved my problem.

So, I'm using Python 2.7, and I get this error (title) whenever I try this:

number = int(raw_input('Number : '))

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.

解决方案

The issue here is that Sublime text 2's console doesn't support input.

To fix this issue, you can install a package called SublimeREPL. SublimeREPL provides a Python interpreter that takes in 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当读取一行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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