Python3.4 IDLE ClearWindow 清屏扩展
来源:互联网 发布:mac ctrl键 编辑:程序博客网 时间:2024/05/16 06:30
1、http://bugs.python.org/issue6143 下载列表中的第二个ClearWindow.py(2009-6-15版本),右键另存为即可。
也可以复制以下内容,新建一个ClearWindow.py
"""Clear Window ExtensionVersion: 0.2Author: Roger D. Serwy roger.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=1enable_editor=0enable_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 = editwin self.text = self.editwin.text self.text.bind("<<clear-window>>", self.clear_window2) self.text.bind("<<undo>>", self.undo_event) # add="+" doesn't work def undo_event(self, event): text = self.text text.mark_set("iomark2", "iomark") text.mark_set("insert2", "insert") self.editwin.undo.undo_event(event) # fix iomark and insert text.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 ModifiedUndoDelegator text = self.text text.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 delegator undo = self.editwin.undo self.editwin.per.removefilter(undo) # clear the window, but preserve current command self.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 delegator self.editwin.per.insertfilter(undo)
2、将文件放到Python安装路径下:Python34\Lib\idlelib(我的是D:\Python34\Lib\idlelib)
3、在相同的路径下,找到config-extensions.def文件
4、用记事本打开,在最后粘上以下代码:
[ClearWindow]enable=1enable_editor=0enable_shell=1[ClearWindow_cfgBindings]clear-window=<Control-Key-l>
5、保存、关闭文件
6、重新启动IDLE,在option下面就有了Clear shell window 选项。快捷键是Ctrl + L
0 0
- Python3.4 IDLE ClearWindow 清屏扩展
- python: IDLE增加清屏的扩展ClearWindow
- python idle 清屏
- Python IDLE 清屏问题
- IDLE清屏的方法
- Python IDLE 清屏问题
- python idle 清屏
- Python IDLE 清屏
- python IDLE清屏
- Python IDLE 清屏
- Python IDLE 清屏插件
- Python IDLE 清屏
- [python]Python IDLE清屏
- python IDLE怎么清屏
- Python的idle清屏
- Python-IDLE实现清屏
- Python IDLE清屏
- Python idle 清屏问题解决
- 多线程——继承Thread类
- http://www.douban.com/note/364664262/
- OpenCV仿射变换+投射变换+单应性矩阵
- git如何合并某次提交命令到分支--git cherry-pick <commit id>
- 一个老程序员对学弟学妹的一些忠告
- Python3.4 IDLE ClearWindow 清屏扩展
- adb uiautomator learn
- IPv4 Options
- 多态学习续 抽象类和接口
- sql不显示重复列
- 兰州脱毛手术大概要多少钱
- 1111
- gcc warning: enum declared inside parameter list
- Installation error: INSTALL_FAILED_UID_CHANGED解决办法总结