Menu

#1525 Input() Function: unexpected EOF while parsing

open
nobody
None
5
2012-08-22
2012-08-22
Anonymous
No

My machine spec:

OS : Win 7 (32 bit)
Eclipse : 1.4.2
Python : 2.7
Pydev : 2.6

It looks like that Pydev is not able handle Input() Function correctly, when an "Enter" key is pressed (or send as input parameter)

Code :

text = input("Enter text:")

if text == "":
print "You pressed ""Enter"" key"

print text

Now execute the code, for "Enter Text:" field just pressed "Enter" key, then we will notice below error message.

Error:

Enter text:
Traceback (most recent call last):
File "C:\PythonX\ProjectPythonTest\PTest\Test.py", line 8, in <module>
text = input("Enter text:")
File "C:\eclipse-jee-indigo-SR1-win32 (1)\eclipse\plugins\org.python.pydev_2.6.0.2012062818\pysrc\pydev_sitecustomize\sitecustomize.py", line 210, in input
return eval(raw_input(prompt))
File "<string>", line 0

^
SyntaxError: unexpected EOF while parsing

Discussion