问题
I'm trying to capture the output of a windows program using Qt and Python.
I'm starting the process with QProcess, but the problem is the output is being buffered. Unfortunately I don't have access to the source, and therefore can't flush the output.
From my searching around, I found the program "Expect", but I don't know if there is a free Windows version floating around.
It would be nice to do it purely in python though.
回答1:
Please take a look at QShared Memory http://doc.trolltech.com/main-snapshot/ipc-sharedmemory.html ... What you want to achieve is inter process communication, QShared memory works fine on Linux and Windows alike.
来源:https://stackoverflow.com/questions/3902997/capturing-output-from-buffered-stdout-program