How to clear the console in python interactive
def cls(): print("\033[H\033[J", end="")
And then --
cls()
Description, from stackoverflow answer --
\033
stands forESC
(ANSI value 27).\033[
is a special escape sequence called Control Sequence Introducer (CSI
).\033[H
command moves the cursor to the top left corner of the screen.\033[J
clears the screen from the cursor to the end of the screen.