.py 文件的 IDLE 编辑消失了 [英] Edit with IDLE disappeared for .py files

查看:70
本文介绍了.py 文件的 IDLE 编辑消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我右键单击 .py 文件时,我曾经有 Edit with IDLE 选项,但我多次卸载/重新安装以使某些东西正常工作,现在它走了.我检查了 HKEY_CLASSES_ROOTHKEY_LOCAL_MACHINE 下的注册表以获取 Python.FilePython.NoConFile 下的值,它是 "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1" 所以我不确定为什么它不起作用.不过它适用于 .pyw 文件.有人可以帮我让它再次工作吗?我也尝试修复我的 python 安装无济于事,并遵循 Python IDLE 从右键单击上下文菜单中消失.

I used to have the Edit with IDLE option when I right-clicked on .py files but I uninstalled/reinstalled multiple times to get some stuff working and now it's gone. I checked the registry under HKEY_CLASSES_ROOT and HKEY_LOCAL_MACHINE for value under Python.File and Python.NoConFile and it is "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1" so I am not sure why it isn't working. It works for .pyw files though. Can someone help me get this working again? I've also tried repairing my python installation to no avail and following Python IDLE disappeared from the right click context menu.

推荐答案

这通常是因为在文本编辑器中打开了 .py 文件,并且不小心将默认的打开方式"选项设置为 Python 以外的选项.

This usually happens because a .py file has been opened in a text editor and accidentally set the default "open with" option to something other than python.

>

试试:

  • 右键单击 .py 文件
  • 打开方式...
  • 选择默认程序...
  • 勾选始终使用所选程序打开此类文件
  • 选择 python.exe

这会在终端中运行脚本,但也会将文件类型设置回 python.

This runs the script in a terminal, but also sets the filetype back to python.

现在再次检查右键菜单.

Now check the right click menu again.

...

对于那些认为 *durr 这不是那么简单* 的人,请先尝试一下 - 它可能会阻止您无缘无故地在注册表中进行黑客攻击!

And for those people thinking *durr it's not that simple*, just try it first - It might prevent you from hacking about in the registry for no reason!

这篇关于.py 文件的 IDLE 编辑消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆