On Tue, Oct 13, 2020 at 03:35:58PM -0700, Guido van Rossum wrote:
> Can one of the educators on the list explain why this is such a commonly
> required feature? I literally never feel the need to clear my screen -- but
> I've seen this requested quite a few times in various forms, often as a bug
> report "IDLE does not support CLS". I presume that this is a common thing
> in other programming environments for beginners -- even C++ (given that it
> was mentioned). Maybe it's a thing that command-line users on Windows are
> told to do frequently? What am I missing that students want to do
> frequently? Is it a holdover from the DOS age?
I think it's a personal preference to remove the visible clutter from
the screen without going so far as to exit the interpreter and start a
new session.
And I do it frequently, in both Python and bash. Because I never
remember the name of the bash command to do it (cls or clear?), and
Python doesn't have one, I just hold down the Enter key for a couple of
seconds until there's no clutter visible.
(I just tried it in bash now, and it is spelled "clear", and it clears
the scrollback buffer as well as just clearing the visible clutter on
the screen.)
Oh, apparently Ctrl-L works too. I don't know if that's a feature of my
terminal or of the Python interpreter.
There's supposed to be a magic escape sequence that will clear the
screen when printed, if your terminal supports it, but I never remember
that either. Let me look it up...
print("\x1b[H\x1b[2J")
seems to work.
--
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/I7SZOAD54SZ264Q7QNM7HO2YMD3QMX5E/
Code of Conduct: http://python.org/psf/codeofconduct/