Sublime Forum

Why won't this script run?

#1

The code below runs fine in the interpreter, but when I put it in sublime text it only gets to the input request and stops without running the indented code block. Not sure what I am doing wrong either in the configuration, setup, or in the code itself…Thoughts?

inp = input("Enter a number: ")
if float(inp) >= 100.0:
print(“That’s big!”)
else:
print(“That’s small!”)

0 Likes

#2

if you check the process list, you’ll see that it didn’t stop, it’s hung in the background waiting for input that you can’t provide. That is, your code is fine, Sublime just doesn’t support running interactive programs as part of a build system.

I’m on mobile at the moment, but if you search around this is a commonly asked question and the answer is usually to use something like SublimeREPL, Terminus or craft a build system that runs your program in an external terminal window.

0 Likes

#3

That’s super helpful! Thanks!

0 Likes