python - "Edit with IDLE"选项缺少 Python 3.6

标签 python

我使用的是 Python 3.6,但缺少“使用 IDLE 编辑”选项。我在 Stack Overflow 和其他网站上阅读了很多关于编辑注册表的主题,但没有任何效果。我已经完全重新安装了 Python 3.6,也尝试过使用 Python 2.7,但我再也没有这个选项了。有什么想法吗?

最佳答案

严格来说不是编程问题,但这里是负责 Windows 资源管理器中 Python 文件上下文菜单项的注册表项。

我制作了一个“使用 IDLE 编辑”子菜单,因为我的机器上安装了多个版本的 Python。

(免责声明:这是手工制作的,不会在您卸载 Python 时自动删除。您必须自己清理它。)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle]
"MUIVerb"="&Edit with IDLE"
"Subcommands"=""

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell]

; Python 2.7 -----------------------------------------------------------------------

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit27-32]
"MUIVerb"="Edit with IDLE 2.7 (32-bit)"

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit27-32\command]
@="\"C:\\Python27\\pythonw.exe\" \"C:\\Python27\\Lib\\idlelib\\idle.pyw\" -e \"%1\""

; Python 3.6 -----------------------------------------------------------------------

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit36-32]
"MUIVerb"="Edit with IDLE 3.6 (32-bit)"

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit36-32\command]
@="\"C:\\Python36\\pythonw.exe\" -m idlelib \"%L\" %*"

当然根据你的安装目录更改路径。根据安装的 Python 版本添加/删除部分。然后另存为 .reg 文件并导入。

另请注意,我选择了合理的子项名称,例如 edit36-32。这不是严格要求,这些只需要是唯一的,但如果我正在创建注册表项,我希望它们包含他们所说的内容。因此,相应地调整它们。


如果您只安装了一个 Python 版本并且从不打算安装第二个版本,或者如果您喜欢顶层菜单条目而不是子菜单:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle]
@="Edit with IDLE 3.6 (32-bit)"

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\command]
@="\"C:\\Python36\\pythonw.exe\" -m idlelib \"%L\" %*"

关于python - "Edit with IDLE"选项缺少 Python 3.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50953131/

相关文章:

python - 有没有人在 PyCharm 中有以下库的 "Documentation URL"s :

python - ValueError : not enough values to unpack (expected 2, 得到 1) 但我提供了 2 个值

python - 了解 scikit-learn 中的 DictVectorizer?

python - 如何将 python 中的 'transform' 类对象转换为 llvm?

python - 循环列表列表并保存不同的文件

python - Pandas 的区间交集

python - 采用多索引 pandas df 的子集,索引的意外行为

python - 使用 Numpy 权重矩阵初始化 TensorFlow CNN 模型

python - 如何在Python中将一维图像数组转换为PIL图像

python - pandas groupby 对象到数据框