I have an interactive Windows console application that I communicate through subprocess
module in my program. So far, the console commands(of the application) that I called from my script did not made any problems because they gave instant results(pipe outputs).
However there are other functionalities I need to use that keeps printing output to the console until it recieves "stop" command. I need to read those outputs, but my application is a GUI and I cannot let any hanging occur, and I don't want to get all the output after stop command is issued, I need to get it realtime, when it is served. I made some research and it appears this is a difficult problem to overcome(especially in Windows), but there are no recent questions about this topic.
I did find this, Non-blocking read on a subprocess.PIPE in python, looks like what I am looking for.
But the answer seems really low-level for a Python solution and it is old. Are there any better-newer solutions for this problem ?
Thanks in advance.