Embedding Python in Windows Applications
Gerson Kurz
gerson.kurz at t-online.de
Sat Dec 30 13:34:17 EST 2000
If I embedd Python in a Win32 console application (using
Demo\embed.c), everything works fine. If I take the very same piece of
code and put it in a Win32 Windows application (not MFC, just a plain
WinMain()) I see no output (and more importantly so, no errors),
because the application does not have a stdout/stderr set up.
I have made the following "hack" to make it work (in VisualStudio)
// stdout, stderr as defined in the MSVCRT
_iob[1] = *fopen("D:\\stdout.log","w");
_iob[2] = _iob[1];
but that surely cannot be a longterm solution. I don't want the output
to be written to a temp file, I want to see it in a callback. Is that
possible, and if so, how ?
More information about the Python-list
mailing list