I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here.
How do I clear python's IDLE window?
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here.
How do I clear python's IDLE window?
If you are using the terminal ( i am using ubuntu ) , then just use the combination of CTRL+l from keyboard to clear the python script, even it clears the terminal script...
The "cls" and "clear" are commands which will clear a terminal (ie a DOS prompt, or terminal window). From your screenshot, you are using the shell within IDLE, which won't be affected by such things. Unfortunately, I don't think there is a way to clear the screen in IDLE. The best you could do is to scroll the screen down lots of lines, eg:
Though you could put this in a function:
And then call it when needed as
cls()
There does not appear to be a way to clear the IDLE 'shell' buffer.
There is no need to write your own function to do this! Python has a built in clear function.
Type the following in the command prompt:
You can make an AutoHotKey script.
To set ctrl-r to a hotkey to clear the shell:
Just install AutoHotKey, put the above in a file called idle_clear.ahk, run the file, and your hotkey is active.
As mark.ribau said, it seems that there is no way to clear the Text widget in idle. One should edit the
EditorWindow.py
module and add a method and a menu item in the EditorWindow class that does something like:and perhaps some more tag management of which I'm unaware of.