How to clear the screen of IDLE?

Source: Internet
Author: User
0 reply content: Is it necessary to be so complex?
Try
Import OS
OS. system ('cls ')
Only one more 0
---------------------------
I forgot to mention it. It only works with cmd, and IDLE does not seem to work.
Why use the built-in idle? It is convenient to integrate to vs and use command lines. Link to the original article: how to solve the python idle screen Clearing Problem

When learning and using python, you must deal with Python IDLE. But using Python IDLE will encounter a common and annoying problem-how to clear the screen?
The answer is to add a clear screen extension ClearWindow for IDLE (in Issue 6143: IDLE ).
The following describes how to install and use it.
1. Download clearwindow. py (Right-click the target and save it as the end of The py format. Directly click it to open the script content ).
2. Copy the clearwindow. py file and place it in the Python installation directory Python XXX \ Lib \ idlelib (XXX is your python version ).
3. notepad open the config-extensions.def under the directory of Python XXX \ Lib \ idlelib (the configuration file of the IDLE extension), to prevent errors, you can copy a backup before opening it.
4. Modify the config-extensions.def, add the following content at the end, and save and exit:
[ClearWindow]
Enable = 1
Enable_editor = 0
Enable_shell = 1
[ClearWindow_cfgBindings]
Clear-window =
5. Open the Python IDLE. The Clear shell window ctrl + is added to the options ;.
6. Enter the code in IDLE and press Ctrl +; (Ctrl and;) to clear the code you just entered.

Note:
The shortcut key Ctrl +; can be changed to another key, and the "clear-window = .
After the test, the IDLE cannot be started when the Control is changed to Alter. when the Control is changed to Shift, the shortcut key does not work because Shift + l is directly input L. You can refer to the solution to the python idle screen Clearing Problem. I also hate idle when I turn it off and reopen it. If I can clear it like matlab, clc will do it in one sentence. Unfortunately, we have to install the plug-in again.

If you don't install the plug-in, I think that's all you have to do.
In the previous few cases, the file name and the first letter of ClearWindow should be capitalized to succeed. It's very troublesome. Close it and restart it. If the clear command is available, the new method in 2016 will be better. python 3.5.1 + Windows
Pip install idlex

Then create a shortcut
C: \ Python3 \ pythonw.exe "c: \ Python3 \ scripts \ idlex. pyw"

Replace the path according to your actual situation.

Disadvantages: Use the arrow keys to perform the input commands up and down. If there are multiple lines of input history, the command will be stuck there. Why can't I do it? What are the steps I did? There is only one Python Configure option under options. Thank you. installation is complete!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.