TRIQS/TRIQS — Issue #43: std::cout not redirected to ipython notebook
Author: mferrero
Created: 2012-02-23 14:40:40+00:00
State: open

Anything written on the screen with std::cout in a c++ extension module will not be redirected to the ipython notebook display. This is a pity because all this information just appears in the console that launched the notebook, e.g. the information written by the TRIQS solver will not be seen in the notebook.

The reason is that ipython notebook basically redefines sys.stdout into an IPython.zmq.iostream.OutStream. Of course the extension module are unaware of this... It looks like the only easy way out is to redirect the std::cout file descriptor and later flush the fd into the OutStream. And I don't see how this can be done on the fly...