April 29th, 2004, 06:15 PM
Python - Is there no way to clear the idle screen?
I've been looking around for hours and it seems there is no way to clear the screen when running your program in the idle window.
The reason I'm looking is we do minor programming assignments in Python that we only run in the idle window. Its easy enough to clear the screen in a dos window but I have not found a definatvie "Its not possible" to do it the idle window.
The only thing I see possible at the moment is to write off blank lines till clear but that seems a little wasteful.
I've seen a couple references to backspacing but it doesn't seem to work in idle.
Any help would be appriciated, if anything just a "no its not possible" so I can give up looking! This is driving me crazy
April 29th, 2004, 09:22 PM
IDLE has no such "clear screen" feature. The best I can recommend is printing blank lines like you suggested.
April 30th, 2004, 04:09 AM
I'm with mamba - there is no way to do this in IDLE - blank lines are very useful though. On the other hand you can always restart IDLE now and again to prevent things from getting too bloated.
April 30th, 2004, 04:34 AM
Undo also could do the job, though not so much intelligent
April 30th, 2004, 09:27 AM
Also i dont think Undo works the same in the version of IDLE packaged with Python 2.3 which is a bit of a bummer - but then i guess undo only removed the line from IDLE rather than undoing the effect on the session in earlier versions. Ah well
April 30th, 2004, 01:49 PM
Thanks for the responces guys. I'm not familiar with undo but I'll take a look at the documentation for it.
At least I can rest easy knowing its not possible!
April 30th, 2004, 02:27 PM
Damn.. I'm still on Python 2.2
Yes, in certain codition, there will be some trouble.
Originally Posted by netytan
April 30th, 2004, 02:41 PM
Looks like the clrscr() function we discussed here is getting popular after all
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
You have the source code to Idle, so it should be possible to modify it to do what you want. Perhaps you could set it as an exercise for the class.
Originally Posted by jarchn
Dave - The Developers' Coach