3
votes

I am using Python 3.6 and the "Edit with IDLE" option is missing. I have read numerous threads here on Stack Overflow and other websites about editing the registry, but nothing works. I have re-installed completely Python 3.6, also tried with Python 2.7 but I just don't get the option anymore. Any ideas?

2
Do you mean when you right click on a file you don't have the option? Also, what operating system? - Davy M
Have you tried re-installing or even just restarting the PC? - Stefan Collier
Yes when I right click I don't have the option / Yes I tried re-installing as I said, also restarting PC / Yes IDLE works fine - vdvaxel
Not a direct answer to the question, but I will just say that IDLE is not a particularly well-featured editor. You may want to consider installing a dedicated programmer's text editor and configuring it for your Python installation(s). There are many such programs with a wide variety of features and capabilities, and (IMO) IDLE does not compete particularly well with pretty much any of them. - Daniel Pryden

2 Answers

6
votes

Not strictly a programming question, but here are the registry keys that are responsible for the context menu entries on Python files in the Windows Explorer.

I've made an "Edit with IDLE" sub-menu as there are multiple versions of Python installed on my machine.

(Disclaimer: This is hand-crafted and will not be removed automatically when you uninstall Python. You have to clean it up yourself.)

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

Of course change the paths according to your installation directories. Add/remove sections according to the installed Python versions. Then save as .reg file and import.

Also note that I've picked sensible subkey names like edit36-32. It's not strictly required, these only need to be unique, but if I'm creating registry entries, I like them to contain what they say. So, adapt those accordingly.


If you have only one Python version installed and never plan on getting a second installation, or if you like the menu entries in the top level instead of in a sub-menu:

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\" %*"
0
votes

I had this problem before. Obviously reinstalling the system will work, but I am kidding, you don't have to do that. I will suggest one way which will work for sure as follows: 1. open regedit 2. under edit: search for "python" 3. delete any term you find and search for next until all terms related to "python" is deleted. 4. Reinstall python, any version you want, Done!!!