import keyboard
Array = []
while not(keyboard.is_pressed('ctrl')):
Array += input()
print(Array)
import signal
import time
class SigHandler:
stop = False
def __init__(self):
signal.signal(signal.SIGINT, self.exit)
signal.signal(signal.SIGTERM, self.exit)
def exit(self, *args):
print(signal.strsignal(args[0]))
self.stop = True
if __name__ == '__main__':
Array = []
signal_handler = SigHandler()
while not signal_handler.stop:
Array += input('Input value: ')
print(Array)
time.sleep(0.5)
print("Exit")