# https://stackoverflow.com/questions/2408560/non-blocking-console-input import time, threading, queue def collect(que): msg = input() que.put(msg) msg = "" while msg!="e": que = queue.Queue() thread = threading.Thread(target=collect, args=[que]) thread.start() while thread.is_alive(): print(".", end="") time.sleep(1) # print("The main thread continues while we wait for you...") msg = que.get() print('You typed:', msg)