Sublime Forum

Ghost error running "try except"test

#1

2019-06-07T23:00:00Z
sublime%20issue|551x499
I have tried deleting and reinstalling sublime 3 latest reboot and still get an odd event running this code in my photo.
rawstr = input(‘Enter a number:’)
try:
ival = int(rawstr)
except:
ival = -1

if ival > 0:
print(‘Nice work’)
else:
print(‘Not a number’)
On pressing ctrl B the “enter a number” comes up in the console I enter a number and then press "return/enter"key on my computer and then nothing happens. My expectation would be that the reply is “Nice work” as this is how it runs on IDLE ok or I have tried it in Jypyter notebooks all ok
I am a beginner doing 2 courses and this “try/except” example is from Dr Chuck course on youtube I am also doing bootcamp course with Udemy but I like using Sublime as its neat.
I can run simple code such as print(“Hello”) and that works ok
I have tried an alternative new build system of Python ie ran a typical hello world and that finished in 0.2sec so why wont it run fully?

0 Likes

#2

You’ll find the answer at

0 Likes