Sublime Forum

Input issue in sublime text 3

#1

Hi SMEs,

I just started using the sublime text3 and writing the code using using Python 2.7 ( 2.7.11). I tried to code with the basic input function but immediately i ran into the issue with input function behavior.

name = input ('cal valuename')
print (name)

after this ran the py file…
But, in the console i can able to see the ‘cal valuename’ text, later provided the input from the key board as **hello** and after that i am expecting that console will print the result but it is not printing anything. So i guess, console/sublime is not accepting the input which i am providing at the console window.

Please assist me to resolve the issue.

Thanks in advance
Swaroop

0 Likes

#2
1 Like

#3

Hello kingkeith,

Thanks for the reply.

I tried with the SublimeREPL, though it did not work fine for me. But, through your post I got an idea to run the program from the console ( Ubuntu -> terminal) instead of build the code within the sublime. finally, it worked … :slightly_smiling:

IN UBUNTU

word = raw_input (“liked word:\t”)
print ( word)
As i mentioned earlier, i am using the 2.7 python, so input package did not work for me. so, tried with the raw_input. Got the output as like this…

liked word:	hello
hello

But the same is not working from my windows cmd prompt… any help on this?
In windows, path variable was properly configured. no issues with the Path. IDE is working fine, except with the input.

0 Likes

#4

Another thing have to take care off: You’re using python 2.7.x, while st uses a python 3.4.x runtime.

There are some differences between py2 and py3, for example in py 2 you write

 print "some text"

and in py3 you write

 print("some text")

For more information: http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html

0 Likes

#5

It doesn’t matter what ST uses internally since the environments are not connected.

ST’s python version only matters when you are writing plugins for it or using its console.

0 Likes