{ } Raw JSON

bundles / IPython 9.17.0 / IPython / core / interactiveshell / InteractiveShell / _tee

function

IPython.core.interactiveshell:InteractiveShell._tee

source: /dev/ipython/IPython/core/interactiveshell.py:3157

Signature

def _tee(self, channel: Literal['stdout', 'stderr'])

Summary

Capture output of a given standard stream and store it in history.

Extended Summary

Uses patching of write method for maximal compatibility, because ipykernel checks for instances of the stream class, and stream classes in ipykernel implement more complex logic.

Aliases

  • IPython.InteractiveShell._tee