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)
| 355 | |
| 356 | |
| 357 | def 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() |
no test coverage detected
searching dependent graphs…