stdin in embedded python

KillSwitch gu.yakahughes at gmail.com
Sun Nov 1 02:37:44 EST 2009


I have a C++ program, with a GUI, into which I have embedded python. I
have made several python functions in C++, one of which I use to
override the normal stdout and stderr so that they print to a text box
of my GUI. One thing I cannot think of how to do is to redefine stdin
so that it pauses the program, waits for a user to type input into the
box, hit enter, and takes input from another text element and sends it
to python like it was the console.

I wonder if anyone could help me in trying to do such a thing. To
simplify, the new stdin should wait for the C++ function to give it a
value, like it waits for the console.



More information about the Python-list mailing list