[Tutor] New Re: Clearing Python text
Dave Angel
d at davea.name
Fri Dec 14 18:12:56 CET 2012
On 12/14/2012 10:25 AM, Waters, Mike [ITSCA Non-J&J] wrote:
> Hi Tutor,
> I am using Win 7 ,Python 2.7. Interpreter.
> To state my challenge : When I have filled a page with values and text until it reaches the bottom of the screen, how can I highlight this and remove to allow further entries? I have seen John Guttag do this but he seems to be using a MAC.
> Thanks
> Mike
>
Are you talking about the DOS box (CMD window, terminal, or any other
alias)? If so, it could be any size, from a few lines up to maybe 50
(or more, depends on the screen resolution of your particular tube).
And what do you mean by full? When your program is generating output
with print statements, once it reaches the bottom of the DOS box, it'll
scroll. Python has no control over that.
If your version of CMD supports ANSI sequences, you could print ESC 2 J
from your program when you want the screen cleared. But easier is just
to print a boatload of newlines, and figure that'll scroll the old stuff
off.
--
DaveA
More information about the Tutor
mailing list