I would like to know how to leave a loop from the terminal, otherwise when closing it...
Thanks!
I tried 'exit', 'leave' and others keywords like that
CodePudding user response:
In Mac and Windows: control C
. In general it terminate a process.
CodePudding user response:
try adding keyboard Interrupt exception
try:
while True:
pass
except KeyboardInterrupt, e:
print "Stopped"
raise