How to clear Interactive Window?

Peter Hansen peter at engcorp.com
Tue May 27 09:39:00 EDT 2003


Uriel Wittenberg wrote:
> 
> I made a 3-line .PY file:
> 
> ---------------------------------
> import os
> os.system('cls')
> print 'hi'
> ---------------------------------
> 
> I run it in PythonWin. It prints 'hi'. I run it again. It prints 'hi'
> again -- now I see TWO hi's, one below the other. I'd like the Interactive
> Window cleared whenever I run the program (so after the above I'd only see a
> single 'hi').

CLS is a DOS command to clear the console window, not a command that
PythonWin will recognize.  PythonWin is its own special environment
and learning to clear the window there might not be a very portable
experience.  (That's short for "I can't help you on PythonWin". :-)

-Peter




More information about the Python-list mailing list