We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3187674 commit 84fe118Copy full SHA for 84fe118
docs/advanced/pycpp/utilities.rst
@@ -31,6 +31,7 @@ not play well with Python's standard `sys.stdout` and `sys.stderr` redirection.
31
This can be fixed using a guard around the library function that has output:
32
33
.. code-block:: cpp
34
+
35
// At beginning of file
36
#include <pybind11/iostream.h>
37
@@ -51,6 +52,7 @@ in realtime, such as to a Jupyter notebook.
51
52
A global method to redirect for the lifetime of the module:
53
54
55
56
m.attr("redirect_output") = py::capsule(new py::scoped_output_redirect(...),
57
[](void *sor) { delete static_cast<py::scoped_output_redirect *>(sor); });
58
0 commit comments