MCPcopy Index your code
hub / github.com/ipython/ipython / clear_output

Function clear_output

IPython/core/display_functions.py:357–371  ·  view source on GitHub ↗

Clear the output of the current cell receiving output. Parameters ---------- wait : bool [default: false] Wait to clear the output until new output is available to replace it.

(wait=False)

Source from the content-addressed store, hash-verified

355
356
357def clear_output(wait=False):
358 """Clear the output of the current cell receiving output.
359
360 Parameters
361 ----------
362 wait : bool [default: false]
363 Wait to clear the output until new output is available to replace it."""
364 from IPython.core.interactiveshell import InteractiveShell
365 if InteractiveShell.initialized():
366 InteractiveShell.instance().display_pub.clear_output(wait)
367 else:
368 print('\033[2K\r', end='')
369 sys.stdout.flush()
370 print('\033[2K\r', end='')
371 sys.stderr.flush()

Callers 1

displayFunction · 0.85

Calls 2

clear_outputMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…