반응형
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)
도움이 필요하세요?
해결 방법
문제가 무엇인지 모르겠지만 raw_input 사용을 고려할 수 있습니까?
사용자의 일반적인 입력에는 raw_input () 함수를 사용하는 것이 좋습니다.
참조 페이지 https://stackoverflow.com/questions/16279564
반응형
'파이썬' 카테고리의 다른 글
파이썬 쉘에서 PYTHONPATH를 얻는 방법? (0) | 2021.01.17 |
---|---|
파이썬 Image.show ()는 그림을 표시하지 않습니다. (0) | 2021.01.17 |
파이썬 Python-공백이없는 JSON (0) | 2021.01.17 |
파이썬 데이터 프레임에 빈 열을 추가하는 방법은 무엇입니까? (0) | 2021.01.17 |
파이썬 장고 모델 메서드-create_or_update (0) | 2021.01.17 |
댓글