On 20Dec2020 08:51, Christopher Barker pythonchb@gmail.com wrote:
On Sat, Dec 19, 2020 at 8:53 PM Guido van Rossum guido@python.org wrote:
at sounds like a very special status. Why not os.clear()?
My anger at programmes which gratuitously clear the screen is large. (Years of anger watching IBM-derived PCs boot, particularly, when I want to see some diagnostic.)
One problem is: what does it mean? On a terminal, easy. But in a GUI? Clear the screen (possibly forbidden)? A window? The "main" window? Etc.
Anyway, I think it should be in curses (or be loaded via curses on demand), and just have a clear_screen function thus:
def clear_screen(): setupterm() print(ti_getstr('cl'), end='', flush=True)
I can already see many ways to bikeshed on that, alas. But the point here is that this is trivial function (albeit often wanted, however misguides I might personally consider that want to often be).
I also have no idea about implementation, but I"m sure there's a few folks with platform expertise that could make this work on many systems out of the box.
On terminals, see above. In a GUI, who knows? And how does one tell the programme which it is talking to?
is it so bad to use a subprocess?
Yes. It is _really slow_, depends on external reaources which might not be there, and subprocess brings other burdens too. Python comes with curses and that knows directly how to do this.
Cheers, Cameron Simpson cs@cskk.id.au