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?
An extension for clearing the shell can be found in Issue6143 as a "feature request". This extension is included with IdleX.
I would recommend you to use Thonny IDE for Python. It's shell has "Clear Shell" option and you can also track variables created in a separate list. It's debugging is very good even comparing with modern IDEs. You can also write code in python file along with access to shell at the same place.
And its lightweight!
ctrl + L clears the screen on Ubuntu Linux.
This works for me in Windows:
print chr(12)
The best way to do it on windows is using the command prompt 'cmd' and access python directory the command prompt could be found on the start menu >run>cmd
File -> New Window
In the new window**
Run -> Python Shell
The problem with this method is that it will clear all the things you defined, such as variables.
Alternatively, you should just use command prompt.
open up command prompt
type "cd c:\python27"
type "python example.py" , you have to edit this using IDLE when it's not in interactive mode. If you're in python shell, file -> new window.
Note that the example.py needs to be in the same directory as C:\python27, or whatever directory you have python installed.
Then from here, you just press the UP arrow key on your keyboard. You just edit example.py, use CTRL + S, then go back to command prompt, press the UP arrow key, hit enter.
If the command prompt gets too crowded, just type "clr"
The "clr" command only works with command prompt, it will not work with IDLE.