[C++-sig] Stdout from c++

Stefan Seefeld seefeld at sympatico.ca
Wed Nov 5 16:42:19 CET 2003

Oliver Walczak wrote:
> Dear list,
> I'm quite new to programming c++ extensions for python (not to the c++
> Language itself) and i'm wondering what might be the simplest way to make
> simple string output to sys.stdout from the c++ api. Can anybody give me a
> hint? I used iostream and cout until now and this works well in the command
> shell, but not running the idle console under windows.

short answer: get a better OS.

long answer: if the OS has the concept of an output stream, and its
              (buggy) std::cout implementation doesn't connect to it,
              write your own streambuf that writes to this output
              stream, then redirect std::cout to use your streambuf.

But that has nothing to do with python programming in C++...

Hope this helps,

More information about the Cplusplus-sig mailing list