pythonpython-2.7textsublimetext2

Python: EOFError: EOF when reading a line


I'm using Python 2.7, and I get this error (title) whenever I try this:

number = int(raw_input('Number : '))

I tried this in Sublime Text 2, compileronline.com and in codecademy; it fails in the first 2 of this sites. It works on codecademy and in the terminal compiler, but I can't understand exactly why it is failing.


Solution

  • The issue here is that Sublime text 2's console doesn't support input.

    To fix this issue, you can install a package called SublimeREPL. SublimeREPL provides a Python interpreter that takes in input.

    And as for compileronline.com, you need to provide input in the "STDIN Input" field on the lower right of the website.