Home > Backend Development > Python Tutorial > Python文件右键找不到IDLE打开项解决办法

Python文件右键找不到IDLE打开项解决办法

WBOY
Release: 2016-06-06 11:19:00
Original
2614 people have browsed it

经常会碰到,双击.py文件运行不了,或右键没有IDLE编辑的项,在WIN7系统中比较常见.
双击*.py文件运行不了解决办法:
右键点击 -> 打开方式 -> 选择默认程序 -> 浏览,找到并选择python.exe

右键没有IDLE项解决办法:
1. 如果PYTHON环境搭建不久,PYTHONPATH,及Lib/site-packages目录下也没有多少库文件时,可以重装
2. 修改注册表,
   i. 通过regedit命令来修改注册表

代码如下:


[HKEY_CLASSES_ROOT\Python.File\shell\EditwithIDLE]
[HKEY_CLASSES_ROOT\Python.File\shell\EditwithIDLE\command]



 ii. 通过批处理文件的方式修改注册表

代码如下:


Windows Registry Editor Version 5.00 
  
[HKEY_CLASSES_ROOT\Python.File\shell\EditwithIDLE] 
@="&Edit with IDLE" 
  
[HKEY_CLASSES_ROOT\Python.File\shell\EditwithIDLE\command] 
@="\"C:\\Python27\\pythonw.exe\" \"C:\\Python27\\Lib\\idlelib\\idle.pyw\" -e \"%1\"" 


保存上面的文件到python.reg,双击一下,就会同样修改注册表,重启生效
NOTE: 替代成你自己的PYTHON安装目录就可以了。

 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template