【发布时间】:2016-03-13 04:44:34
【问题描述】:
我试图让第二个打印语句等到我在命令行中按 Enter 键,但我不断收到意外的 EOF 错误。
print "hi"
continu = input("Press Enter to continue!")
print "hi"
这是我的回溯
Traceback (most recent call last):
File "save_cookies.py", line 2, in <module>
continu = input("Press Enter to continue!")
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
【问题讨论】:
-
你是如何运行你的脚本的?我的意思是
python save_cookies.py? -
您使用的是哪个 python 版本?看起来您正在混合使用 python2 和 python3 语句
-
@AyushShanker 我在 geany 中按 F5。
-
是的,您使用的是哪个 Python 版本?
-
如果您使用的是 Python 2.x,请将
input更改为raw_input。
标签: python command-line terminal