Bodhidarma
Bodhidarma

Reputation: 559

EOFError when using raw_input

I am learning python via codeacademy's python syntax tutorial but when I run the same working code in SublimeText2 the code does not build properly. I have version 2.7 of Python installed on my mac for the record.

original = raw_input('Enter a word:')
print original

I am wondering why this code would work in codeacademy's syntax lesson but not work in my text editor. The error produced occurs immediately upon running the code. The user is given no chance to respond to the prompt.

Traceback (most recent call last):
File "/Users/Tom/Documents/firstsublimeentry.py", line 1, in <module>
original = raw_input('Enter a word:')
EOFError: EOF when reading a line
Enter a word:[Finished in 0.0s with exit code 1]

Upvotes: 0

Views: 641

Answers (1)

user4209617
user4209617

Reputation:

Sublime Text's console is not able to capture input. To execute your code, either use a python shell, execute it from the command line, or install the Sublime Package SublimeREPL via Package Control.

Upvotes: 3

Related Questions