0

is there a way on IDLE to close the users shell if they were to enter something that would be supposed to "quit"?

rino
  • 13
  • 2

1 Answers1

1

You can use exit(0) to terminate the program, as follows:

while True:
    i = input()
    if i == "quit":
        exit(0)
    else:
        # do something
        pass

For more information about what 0 for exit() means: Difference between exit(0) and exit(1) in Python

Park
  • 2,446
  • 1
  • 16
  • 25