how to break while loop on click of keys in python code example
Example: python loop break on keypress
try:
while True:
do_something()
except KeyboardInterrupt:
pass
try:
while True:
do_something()
except KeyboardInterrupt:
pass