1、找到python的安装目录在python (版本号)\lib\idlelib目录下 添加Clearwindow.py文件 源代码如下: class ClearWindow: menudefs = [ ('options', [None, ('Clear Shell Window', '<>'), ]), ] def __init__(self, editwin): self.editwin = editwin self.text = self.editwin.text sel