0
how to make program stop
5 Respuestas
+ 3
Ctrl-C is 'break/interrupt' : use for infinite loops or long calculations.
Ctrl-D is 'end of transmission / stream' . Use to exit some types of input, allowing a previous Ctrl-C to immediately take effect when it's being ignored.
sys.exit() - as long as the program reaches it - not for infinite loops you'd have to 'break' to exit.
Ctrl-Z : (not Windows) - pause process into background, displays interactive shell. View with 'jobs'. Terminate if necessary.
kill / task manager - used externally to terminate when necessary.
+ 2
Ctlr+C
0
You can do this with sys.exit()
import sys
sys.exit("Exit message")
0
input("Enter any Key to exit")
0
use the exit function eg. exit()