Python IDEL adds the clear screen function and pythonidel clear screen function
Add a clear window extension for the idle (see the description of this extension in http://bugs.python.org/issue6143 ).
The following describes how to install and use it. First download clearwindow. py (you can click to download directly. If you cannot download it, you can right-click to save it. The format ends with py). Put this file in the Python X \ Lib \ idlelib directory (X for your python version ), then find the config-extensions.def file (the idle Extension Configuration File) in this directory and open it in Notepad (to prevent errors, you can copy a backup before opening it ). Yes, it may look very dense after it is opened. If you can, it is recommended that you use a Notepad ++ or vim editor to open it.
After opening the config-extensions.def, add the following sentence at the end of the sentence:
[ClearWindow]
Enable = 1
Enable_editor = 0
Enable_shell = 1
[ClearWindow_cfgBindings]
Clear-window = <Control-Key-l>
Save and exit.
Open the python idle and check whether there is an option clear shell window ctrl + L in options.
If this is the case, it will prove that you have successfully installed it. In the future, you need to clear the screen and press ctrl + L.