Another question about PythonWin

Matt Gerrans matt_gerrans at hp.com
Mon Nov 11 20:17:28 EST 2002


"Tony Cappellini" <tony at tcapp.com> wrote:
>
> When I call os.system('cls') in Pythwonwin, a window opens then closes,
but
> my interactive screen never gets cleared :(

Exactly what you should expect.

> If I execute the same command in IDLE, IPython, or python.exe ,the screen
> is cleared .

I think you may want to check again.   It will work in the console window
for Python in interactive mode, but I don't see how IDLE would handle this
any differently than PythonWin (unless the IDLE shell was actually
intercepting this particular special, which it isn't, AFAIK).

os.system('cls') is just opening a shell console window and calling "cls" in
it, which has nothing to do with Python (and is platform-specific, by the
way).

If you want to clear the interactive window in PythonWin, I think you can
simply select everything (Ctrl-A) and either cut (Ctrl-X) or delete it.

I thought I had seen a "clear" menu item some time in the past (in IDLE or
PythonWin), but when I just looked now, I don't see it...





More information about the Python-list mailing list