I'm extending a windows application (C++) by embedding Python calls. It
seems to be a known problem that windows applications detach immediately
from the calling console, so that all output to stdout (from both C++
and Python) doesn't get shown anywhere.
A workaround seems to be the allocation of a windows console and
redirecting stdout to it:
freopen("conin$", "r", stdin);
freopen("conout$", "w", stdout);
freopen("conout$", "w", stderr);
Still, this console only shows the output of my C++ application, not the
output of the embedded python calls.
The following code
std::cout << "start printing..." << std::endl;
std::cout << "done printing." << std::endl;
Does anybody know how to fix this issue? Basically I want to get an
ipython console running in the background of my Windows app, so that I
can process its data.
Grokbase › Groups › Python › python-list › September 2007