How to Make Python Wait for a Quit Command
Programs created in Python that ask for user input immediately exit (by default) once the last input from the user is received. This can be inconvenient if you want the user to be able to read the screen at his leisure before it disappears. The solution to this issue is to add a check at the end of the program that makes the program wait for the user to type "quit" and press "Enter" before exiting.
Instructions
-
-
1
Open your Python program in your editor of choice.
-
2
Go to the end of the program, directly before the last command that you execute before the program ends.
-
-
3
Type "wait:quit=true;" before the last command.
-
4
Save the file and recompile it in your compiler of choice. When the program is run, it will wait for the user to type "quit" and press "Enter" after the last portion of the program runs.
-
1