Why is there no platform independent way of clearing a terminal?

Ulrich Eckhardt eckhardt at satorlaser.com
Wed Jul 28 03:08:24 EDT 2010


Daniel Fetchinson wrote:
> After getting the technicalities out of the way, maybe I should have
> asked:
> 
> Is it only me or others would find a platform independent python API
> to clear the terminal useful?

There are two kinds of programs:
1. Those that process input to output. If one of those suddenly started by
clearing my screen, I'd just dump it. Also, if output is redirected to a
file or piped into another program, that is basically useless or even
hurting, since you then end up with control sequences in the file.

2. Those that provide a text-based interactive UI. Those typically not only
clear the screen, but also control its whole layout and content, so there
you don't only need ways to clear the screen but also to position the
cursor or draw boxes etc. In that case you need a full "curses" library.

Summary: No, I don't see the need for such an API.

Cheers!

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list