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