"Edit with IDLE" option missing from context menu

Directly from: https://superuser.com/questions/343519/python-idle-disappeared-from-the-right-click-context-menu

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\""

Most of the time when this problem occurs, people will read answers directing them into the windows registry, often unnecessarily.

In the majority of cases, the registry key

HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command

will already exist and have the correct value, but it will only be used by Windows shell context menu if .py files are set by default to open with python.exe.

This is the first thing to check, and solves the problem in the majority of cases:

  • right click on a .py file
  • open with...
  • choose default program...
  • tick always use the selected program to open this kind of file
  • choose python.exe

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

Now check the right click menu again.


As a newer update, for people that are having the "missing idle" issue with Windows 10 using Python 3.6 (64-bit).

From my experience, this happens when you install other python editors, and you change your default app to open with that editor.

The easiest way to fix this issue is to click the "start" button, then navigate to settings --> System --> Default Apps --> "Choose default apps by file type". Scroll down till you find ".py" file type and click on the icon and choose "Python"(has a little rocket ship in the icon). This will change your default app back to "Python.exe", and the context menu "edit with idle" will appear once again on your ".py" files.

Hope this helps!