日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python3.7的IDEL怎么清屏

發布時間:2023/12/14 python 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python3.7的IDEL怎么清屏 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.找到ClearWindow.py,并下載

"""Clear Window Extension Version: 0.2Author: Roger D. Serwyroger.serwy@gmail.comDate: 2009-06-14It provides "Clear Shell Window" under "Options" with ability to undo.Add these lines to config-extensions.def[ClearWindow] enable=1 enable_editor=0 enable_shell=1 [ClearWindow_cfgBindings] clear-window=<Control-Key-l>"""class ClearWindow:menudefs = [('options', [None,('Clear Shell Window', '<<clear-window>>'),]),]def __init__(self, editwin):self.editwin = editwinself.text = self.editwin.textself.text.bind("<<clear-window>>", self.clear_window2)self.text.bind("<<undo>>", self.undo_event) # add="+" doesn't workdef undo_event(self, event):text = self.texttext.mark_set("iomark2", "iomark")text.mark_set("insert2", "insert")self.editwin.undo.undo_event(event)# fix iomark and inserttext.mark_set("iomark", "iomark2")text.mark_set("insert", "insert2")text.mark_unset("iomark2")text.mark_unset("insert2")def clear_window2(self, event): # Alternative method# work around the ModifiedUndoDelegatortext = self.texttext.undo_block_start()text.mark_set("iomark2", "iomark")text.mark_set("iomark", 1.0)text.delete(1.0, "iomark2 linestart")text.mark_set("iomark", "iomark2")text.mark_unset("iomark2")text.undo_block_stop()if self.text.compare('insert', '<', 'iomark'):self.text.mark_set('insert', 'end-1c')self.editwin.set_line_and_column()def clear_window(self, event):# remove undo delegatorundo = self.editwin.undoself.editwin.per.removefilter(undo)# clear the window, but preserve current commandself.text.delete(1.0, "iomark linestart")if self.text.compare('insert', '<', 'iomark'):self.text.mark_set('insert', 'end-1c')self.editwin.set_line_and_column()# restore undo delegatorself.editwin.per.insertfilter(undo)

2.講ClearWindow.py復制到Python安裝路徑下:Python37\Lib\idlelib

3.在相同的路徑下,找到config-extensions.def文件

4.打開config-extensions.def文件,在文件末尾加入以下代碼:

[ClearWindow]
enable=1
enable_editor=0
enable_shell=1
[ClearWindow_cfgBindings]
clear-window=<Control-Key-l>

保存文件,并關閉

5.退出IDEL,重新打開,在option下面就有了Clear shell window ctrl+;選項

6.在IDLE輸入代碼,然后按Ctrl+;(是指Ctrl和;),發現剛輸入代碼可以被清除了。

總結

以上是生活随笔為你收集整理的python3.7的IDEL怎么清屏的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。