Python IDLE disappeared from the right click context menu

My IDLE shortcut in the right click menu has disappeared. I think it's because I used to use Python 2.7, but I installed Python 2.5 without uninstalling Python2.7, and then uninstalled Python 2.5. I found one file named idle.bat, and it works, but that isn't a good way to solve this problem.


Solution 1:

Here's a reg file to add the command to edit with IDLE for Python.File (.py) and Python.NoConFile (.pyw) file types. It's for Python 2.7, installed in C:\Python27, so substitute the paths to pythonw.exe and idle.pyw that are relevant to your installation. Save it to a .reg file. Then right-click and choose Merge.

Windows Registry Editor Version 5.00

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

[HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command]
@="\"C:\\Python27\\pythonw.exe\" \"C:\\Python27\\Lib\\idlelib\\idle.pyw\" -e \"%1\""

Solution 2:

This worked for me:


(Also view: edit with idle (python gui) context menu windows-7)

  1. open regedit

  2. go to [HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command], if it doesn't exist create it.

  3. copy the following line into the registry:

    "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1"

  4. go to [HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command], if it doesn't exist create it.

  5. copy the same line in the the registry:

    "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1"

Note: if your python path is different (e.g. c:/program files/...) then change the paths to match the pythonw.exe and idle.pyw file locations.

This should also work for a clean ActivePython install (to give you that classic idle feel!).