MCPcopy Create free account
hub / github.com/ipython/ipython / clear_output

Function clear_output

IPython/core/display.py:1455–1469  ·  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

1453
1454
1455def clear_output(wait=False):
1456 """Clear the output of the current cell receiving output.
1457
1458 Parameters
1459 ----------
1460 wait : bool [default: false]
1461 Wait to clear the output until new output is available to replace it."""
1462 from IPython.core.interactiveshell import InteractiveShell
1463 if InteractiveShell.initialized():
1464 InteractiveShell.instance().display_pub.clear_output(wait)
1465 else:
1466 print('\033[2K\r', end='')
1467 sys.stdout.flush()
1468 print('\033[2K\r', end='')
1469 sys.stderr.flush()
1470
1471
1472@skip_doctest

Callers

nothing calls this directly

Calls 2

clear_outputMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected