Capturing output from buffered StdOut program

孤街浪徒 提交于 2019-12-24 19:10:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!