while True:
reply = input('Enter text')
if reply == 'stop': break
print(reply.upper())
The result was:
Enter text:Traceback (most recent call last): File "C:\PythonProjects\5.py", line 2, in <module> reply = input('Enter text:') EOFError: EOF when reading a line [Finished in 0.2s with exit code 1]
It is only in Sublime Text 2. I tried IDLE, tried command line, everything is perfect. Why should Subleme shout at me?
By the way, maybe you could also explain my what EOF may mean in such situation. Of course, I have read in the documentation, that if EOF is read from input, the appropriate error is raised. I would like to model this situation. Is input only about the keyboard? If yes, what combination of keys should I input to get EOF?
Thank you in advance.
I had the same problem. The problem with the Sublime Text's default console is that it does not support input.
To solve it, you have to install a package called SublimeREPL. SublimeREPL provides a Python interpreter which accepts input.
There is an article that explains the solution in detail.