我有以下Python代碼:爲什麼input()在我按下回車鍵時出錯?
print 'This is a simple game.'
input('Press enter to continue . . .')
print 'Choose an option:'
...
但是,當我按下回車按鈕,我得到以下錯誤:
Traceback (most recent call last):
File "E:/4.Python/temp.py", line 2, in <module>
input('Press enter to continue . . .')
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
附:我在Windows 7上使用Python IDLE 2.6版。
+1例如:-) – user225312 2011-02-17 07:20:59