我可以设置IDLE默认启动Python 2.5吗?

Tom*_*Tom 2 python python-2.5 coexistence python-idle python-2.7

好的,所以我刚刚安装了Python 2.7,但我已经准备好了python 2.5.我意识到因为我最后安装了Python 2.7,IDLE会自动打开Python 2.7 IDLE,这是我不想要的.当我在python源文件上使用右键单击选项时,有没有办法将Python 2.5 IDLE设置为自动打开?谢谢.

Mar*_*nen 9

您可以轻松地创建或编辑文件的右键单击属性.

编辑特定文件扩展名的右键单击菜单:

  1. 运行assoc .py命令行并注意该协会的名称:

    C:> assoc .py
    .py = Python.File

  2. regedit.exe.

  3. 浏览到HKEY_CLASSES_ROOT\Python.File\shell.
  4. shell被调用下创建一个键Edit with IDLE(或者你希望它显示在菜单中).
  5. Edit with Idle被叫下创建一个键command.
  6. 编辑默认值以运行所需的命令.使用"%1"插入右单击文件的名称.就像是:

    c:\ python25\pythonw.exe c:\ python25\lib\idlelib\idle.pyw"%1"

或者,只需保存以下内容,idle.reg然后双击它以将此值插入注册表中.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command]
@="\"C:\\Python25\\pythonw.exe\" \"C:\\python25\\Lib\\idlelib\\idle.pyw\" \"%1\""
Run Code Online (Sandbox Code Playgroud)