[Tutor] Clearing the screen?

D-Man dsh8290@rit.edu
Tue, 6 Feb 2001 13:19:15 -0500


On Tue, Feb 06, 2001 at 11:17:57PM +1100, Glen Wheeler wrote:
|   Don't know if this is the answer your looking for - but you could say
| print a whole bunch of empty line...like say
| 
| pirnt "\n" * 50
| 
|   It sorta clears the screen :)
| 

I was going to suggest a similar thing.

If the script will be running on a *nix system you could take a look
at the ncurses module.


Reading your message again, it could be that you will run the
interpreter more than once on the command line (as opposed to a loop
in your program).  If that's the case, you could have the script run
with a shell/batch script.  ex:

cls
C:\python\python.exe myscript.py

or

#!/bin/sh
clear
./myscript.py


| 
| ----- Original Message -----
| From: John Precedo <johnp@reportlab.com>
| To: python-tutor mailing list <tutor@python.org>
| Sent: Tuesday, February 06, 2001 10:42 PM
| Subject: [Tutor] Clearing the screen?
| 
| 
| > Hi everyone!
| >
| > Right, say you have a program that does nothing fancy, just
| > prints output to STDIO. The output is nothing fancy
| > either -just text. But, you want to make each run distinct -
| > you don't want junk from one run cluttering up the screen on
| > the next run and confusing you.
| >
| > Is there any simple way of clearing the screen? Something
| > like the old Basic CLS command?

-D