Just add a screen-clearing extension ClearWindow to idle (you can see the description of this extension in).
Below I will talk about the installation and use methods. First download clearwindow.py (click to download directly, if you cannot download it, you can right-click to save, the format ends with py), put this file in the Python X\Lib\idlelib directory (X is your python version), and then in this directory Find the file config-extensions.def (the idle extension configuration file), and open it in Notepad (to prevent errors, you can copy a backup before opening it). Well, it may look dense after opening it. If possible, it is recommended that you use an editor like Notepad++ or vim to open it.
Open config-extensions.def and add the following sentences at the end:
[ClearWindow]
enable=1
enable_editor=0
enable_shell=1
[ClearWindow_cfgBindings]
clear-window=
Then save and exit.
Open python's idle and see if the options have an additional option clear shell window ctrl+L
If this is the case, it proves that your installation is successful. You will need to clear the screen directly in the future. Just ctrl+L.
The above is the detailed content of Python's IDEL adds screen clearing function. For more information, please follow other related articles on the PHP Chinese website!