Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Set the IDEL shortcut key to clear the screen in python

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Download to your local computer via the link below

Https://bugs.python.org/file14303/ClearWindow.py

Change the suffix of this text to the ClearWindow.py copy ClearWindow.py file and put it in the Python installation directory Python XXX\ Lib\ idlelib (XXX is your python version). Notepad opens the config-extensions.def (configuration file for the IDLE extension) in the Python XXX\ Lib\ idlelib directory. To prevent errors, you can copy a backup before opening it. Modify config-extensions.def, add the following at the end, and then save exit:

Add the following configuration at the end of the file:

[ClearWindow]

Enable=1

Enable_editor=0

Enable_shell=1

[ClearWindow_cfgBindings]

Clear-window=

To explain what that means.

Enable=1

# 1 really means to enable this extension

Enable_editor=0

# Editor disables this extension

Enable_shell=1

# IDLE Shell starts the extension

Clear-window=

# set the shortcut key to Ctrl + L

6. At this point we open the Python IDLE Shell

Click Options and you can see that our extension has been loaded successfully.

7. Similarly, we can press Ctrl + L to clear the screen. We can also modify shortcut keys through clear-window=. For example, if you change it to ctrl + 3, it will be clear-window=.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report