I'm writing a multithreaded program with an interactive console:
def console()
import readline
while True:
data = input()
do_whatever(data.split())
However, a library I'm using runs my callbacks from a different thread. The callback needs to print to the console. Thus I want to clear the command line, re-display the prompt, and re-show the command line.
How do I do that, short of re-implementing readline
?