Sublime Forum

.py file not executing on Sublime but works well on IDLE and Terminal

#1

Hi all,
Working on sublime 3.1.1. Have set the build to Python. Beginner level with Mac and Catalina OS. Following is the script that I am working on. It executes without an issue in Python IDLE and also running directly from the terminal but Sublime is not showing up correct response.

print(“Welcome to my Glasgow coma scale calculator!”.center(80,’*’))

motorScore = input("Enter motor score of the patient: ")
eyeScore = input("Enter eye opening score of the pateint: ")
verbScore = input("Enter verbal score of the patient: ")

try:
GCScore = int(motorScore) + int(eyeScore) + int(verbScore)
except:
print(“ERROR !! Please enter category specific numeric values only. Retry”)
quit()

print(“The Glasgow coma scale of this patient is”, GCScore)

print()

if GCScore <= 8:
print(“Its a severe head injury with a poor prognosis”)
if GCScore >= 13:
print(“Its a mild head injury with a good prognosis”)
if GCScore > 8 and GCScore < 13:
print(“Its a moderate head injury with a guarded prognosis”)

This code works will with Python IDLE and also running from the terminal, however it works “partially” executing first two lines and then it just executes whatever user enter and never quits. Attached is the snap shots of the response.
Please help,
Thanks

0 Likes

#2

Sublime’s build system does not support taking input. Please see Build broken? - Python 3 - input()

0 Likes