I use Python 3.6, the multiprocessing library.
There is a processing () function that writes something to the console. This function is started from main () as follows:
p = multiprocessing.Process(target=processing)
This is a long-running function.
In this case, main () in the loop is waiting for input from the user.
while True: print("input command: ") inp = input() if inp == "processing": p = multiprocessing.Process(target=processing) p.start() if inp == "whatever": whatever() It turns out the situation when main () gave an invitation and waits for input, and processing writes after that.
input command: *processing* input command: <-приглашение есть, но дальше выводится текст processing started processing finished The question is , is it possible from main () to somehow track the entry in the console of third-party text and repeat the invitation?