Class cap_cout

class o2sclpy.cap_cout

Capture std::cout into a python string in order to output it to a jupyter notebook. One should use open() to begin reading std::cout and then close() to stop reading and output the contents using the Python print() functions.

Based on capture-the-stdout-from-a-c-shared-library-to-a-variable

and see also

captured_stdout = ''

Close the pipe and restore the original stdout


Collect the pipe output to captured_stdout


Duplicate stdout and create a new pipe

stdout_fileno = 1
stdout_pipe = 0
stdout_save = 0
thr = 0