Sublime Forum

Strange is this a bug?

#1

I typed this line in Sublime Text 2 alpha, 20110127
num1 = float(raw_input(‘Enter the amount’))

and build it to produce the following error

Enter the amountTraceback (most recent call last):

File “D:\python\foo.py”, line 1, in

num1 = float(raw_input('Enter the amount'))

EOFError: EOF when reading a line

0 Likes

#2

When running a program within Sublime Text 2, stdin will not be connected to anything (where would you type it?), so this behavior is expected.

0 Likes

#3

I see thank you for the quick answer

0 Likes

#4

I think this is a bug.

Most other text editors that I have used allow you to type in to the are where the output comes out.
Eclipse works like this.
Scite works like this (I am guessing Sublime is the same under the hood as Scite, it looks like Sublime uses the scintilla lib like Scite).

Be good if Sublime 2 worked like this as well.

0 Likes

#5

Sublime Text does not use Scintilla, nor anything else from Scite

0 Likes

#6

Ah OK, sorry, I just thought it looked a bit like it might use scintilla.

Do you think it will be possible to add this feature though, it would be really useful. As at the moment I am editing my code in Sublime and then running it in scite or eclipse, which is not a very efficient way of working, be good if I could do it all in sublime.

0 Likes

#7

Would it be possible to unify the build output and the console so that you could type back?

0 Likes

#8

Are there many other code editors that execute code that don’t support STDIN in the console?
This seems quite odd to me. I mean, the console displays the output from STDOUT and syntax errors.

I guess when I want to read from STDIN while debugging my code I will use CodeRunner instead.

0 Likes

#9

I just built a plugin to solve this problem: github.com/eric-wieser/build-with-input

0 Likes

#10

Ok how can we instal this plug in ? Package control doesn’t work with me.

0 Likes

#11

I found it by myself :
You just need to download the “build-with-input-master” file and insert it in the “Sublime Text 2\Packages” folder amidst all the other previously installed.
The precise path of my folder is, in windows 7 : C:\Users\Guillaume\AppData\Roaming\Sublime Text 2\Packages
But it could be another one for you.

By the way it’s working and thx to the author.

0 Likes