我不斷收到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