[Tutor] "Clean screen" (where screen==stdout) functionality n eeded,but o n Windows

Branimir Petrovic BranimirP at cpas.com
Fri Oct 29 00:09:03 CEST 2004


> -----Original Message-----
> From: Alan Gauld 

> > I am looking for a way to occasionally clear whatever executing
> Python
> > script have sent to stdout so far.
> 
> THis comes up a lot but unfortunately it is platform specific so
> there is no nice neat answer.
> 

Pity there isn't something of the sort. I'd love to be able to 
build Python apps that visually look and feel like good ole Norton 
Commander (MC nowadays) so it would look the same, be easy to
navigate via keyboard only and work the same regardless of the 
platform it runs on (built of "standard parts" too if possible). 


> > "DOS-box" cls equivalent is preferred, although if all other fails I
> > might just print N empty lines to scroll printed stuff out of the
> way...
> 
> os.system('CLS')
> 
> may be your best bet...
> 

Ah that's it exactly! I remembered seeing something to run OS 
commands, but in moment of need - couldn't remember what it was. 
Search on exec/execute theme proved futile, and context sensitive 
(by what you want to do) search does not exist. Python's standard 
library definitely needs better documentation... 

So for now os.system('cls') will do, and if I really care about
keyboard navigatable NC look-alike, paradoxically - it will have 
to be done/emulated via GUI toolkit.


> -----Original Message-----
> From: Kent Johnson 

> You might want to take a look at wconio: 
> http://newcenturycomputers.net/projects/wconio.html
> 

Looks like I'll be able to add some bells (if not whistles too)
to my "half-a-pony-show" (os.system('cls')) after all;) Thanks 
for the pointer!

Branimir


More information about the Tutor mailing list