[Tutor] Capturing stdout/stderror from linked c++ program

Magnus Lycka magnus@thinkware.se
Tue Mar 11 04:50:01 2003


Douglas Eck wrote:
>This all works beautifully.  However, the c++ code prints some important
>information to stdout (cout << info << endl;) during the run of the
>network. Is there a way to capture this standard output so that I can
>display it using wxLogMessage() (from wxPython) in my python GUI?

This does rings a bell...

Ask at the wxPython-users mailing list, and I think you might
get a better reply. I realize that this isn't really a wxPython
issue, but I'd try anyway.

Subscribe by mailing to wxPython-users-subscribe@lists.wxwindows.org

If there isn't any pure python solution, might it be possible to
do some trick in the wrapper code for the C++ program? Perhaps cout
could be redirected to another stream, and that could be made
available from python as a file object?


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se