我不断收到EOF错误。我没有看到任何理由为什么应该对我大喊大叫。我已经尝试在3.3和2.7中运行它,所以我想一定有什么问题。虽然我在Cloud 9时没有遇到任何错误,但它不会真正运行。当我使用不同的IDE时,我遇到了这个错误。读取行时出现Python EOF错误
Executing the code....
$python3 demo.py
Hello! What is your name?Traceback (most recent call last):
File "demo.py", line 2, in
name = input("Hello! What is your name?")
EOFError: EOF when reading a line
这是我的代码。
import sys
name = input("Hello! What is your name?")
print("So your name is {0}? Cool!".format(name))
age = input("Now tell me how old you are.")
print("So your name is {0} and you're {1} years old?".format(name, age))
yn = input("Y/N?")
if yn == "y":
print("Okay good!")
elif yn == "n":
sys.exit(0)
任何帮助?
你在运行哪个程序? – jamylak 2013-04-29 13:15:49
@jamylak看起来像'$ python demo.py dev/null' ;-)类似的东西 – Aya 2013-04-29 13:27:39