1

I want to use a SublimeText2 as IDE for developing applications in Python.

I have the following problem :

When I make a new file, save it as a python and do Tools -> Build System -> Python CTRL + B

I get this error:

Please type your name and press enter: Traceback (most recent call last):
  File "/Users/strielok/Desktop/hello.py", line 1, in <module>
    personsname = raw_input("Please type your name and press enter: ")
EOFError: EOF when reading a line
[Finished]

Here is the code of the program:

 personsname = raw_input("Please type your name and press enter: ")
    print "Hello " +personsname

However when I run this code from terminal (I am on Mac), it works perfectly.

Any idea what the problem might be ?

Michał Lach
  • 1,291
  • 4
  • 18
  • 37

3 Answers3

2

Install sublimeREPL and then choose Tools->sublimerepl->python.

Reference:http://gimo.me/sublime-text2-skills/

Austin Henley
  • 4,625
  • 13
  • 45
  • 80
huixuan
  • 36
  • 3
1

Taken from Sublime Text's forums, seems that stdin will not be connected with anything so it's expected.

Source: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=1519&p=6908&hilit=python+input#wrap

0

I've written a plugin which allows builds in sublime text to take input. It's a bit rough around the edges, but it works on my machine.

Eric
  • 95,302
  • 53
  • 242
  • 374