-2

I'm starting with python today. I have installed python 3.5.1. i have sublimetext 3. after completing Hello world program, when i try to take input from the user either its not accepting the input or its not printing it(I'm not sure).

y = input("number?")
print(y)

the image includes the screenshot of the code and console

  • I didn't downvote, but you might get more help if you post the two lines of code here and tell us what "its not taking" means. Are you unable to input a value in the IDE you are using? (If it is an IDE) Is it not printing it out again after accepting an input? – doctorlove Jun 14 '16 at 16:11
  • @harshahegde No, Sublime is ***NOT*** an IDE. It is a very nice code editor with a good Python API allowing for external plugins that can provide some IDE-like capabilities, but it is not an IDE in and of itself. – MattDMo Jun 14 '16 at 17:09

1 Answers1

1

When you run a Python script in SublimeText, the console that opens at the bottom is an output view only. It's not a full terminal, just a display of the program's output. As a result, it doesn't accept input.

If you want to interact with your script, you'll need to run it in a real terminal program that's actually hooked up to stdin.

On Windows, you can open the command line by pressing the Windows key, typing "cmd" into the search bar, and pressing Enter. Try ConEmu or Git Bash if you want a better command prompt than the standard one from 1995.

Henry Keiter
  • 16,863
  • 7
  • 51
  • 80