1、WIN+R打开运行窗口,然后输入regedit,【确定】后打开注册表编辑器。如下图:

鼠标点击右键加入Edit with IDLE      鼠标点击右键加入Edit with IDLE鼠标点击右键加入Edit with IDLE


2、找到 HKEY_CLASSES_ROOT\SystemFileAssociations,右键——新建——项,增加一个 .py 文件夹,注意py前有一点。

鼠标点击右键加入Edit with IDLE 鼠标点击右键加入Edit with IDLE


3、在.py用同样方法,然后逐层往下,依次新建shell\Editwith IDLE\command,如下图所示:

鼠标点击右键加入Edit with IDLE 鼠标点击右键加入Edit with IDLE


4、选中command,修改默认值为 "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1"。

注意,前面是你python安装路径,我是安装在C盘,所以是C:\Python27。

鼠标点击右键加入Edit with IDLE鼠标点击右键加入Edit with IDLE


5、确定之后就完成添加了。选中一个py文件右键试试吧。

鼠标点击右键加入Edit with IDLE


以上内容是根据网上的搜索结果整理记录下来的,以防忘记,留贴记录。

相关文章: