"Edit with IDLE" option missing from context menu
Asked Answered
S

12

29

I have Python 2.7.5 that installed with ArcGIS 10.2.2. When I first right-clicked a .py script I'd previously written it listed the "Edit with IDLE" option in the context menu. However, this option no longer appears when I right-click a .py file.

I have read numerous threads concerning this issue and attempted some of them, such as modifying/removing registry keys and then reinstalling/repairing the software. I am not interested in using an IDE at this point, though many will be happy to know I intend to use an IDE later on. Right now, the purpose is to fix the problem rather than avoid and work around it.

I appreciate the help I've gotten from the online community in the past, and I'm confident someone will come through with a solution for me.

How do I get "Edit with IDLE" back in the context menu?

Silage answered 21/3, 2015 at 5:35 Comment(0)
A
15

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\""
Augur answered 21/3, 2015 at 6:1 Comment(1)
In my case this some how dosent work. Maybe because i got ArcGIS installed? But it worked after changing the same commands in the other path [HKEY_CLASSES_ROOT\pyfile\shell\Edit with IDLE\command]Amphipod
D
34

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.

Downwind answered 16/12, 2015 at 20:32 Comment(6)
This definitely worked for me. Checked the Registry keys mentioned in Teodorico Levoff's answer and slightly different ones already existed for Python 3.5. However, there was no default program set up for *.py files. Once the default program was set the Edit with IDLE context menu appeared.Taken
Thank you so much! I was at my wit's end trying to figure out why it wasn't working and not even reinstalling helped.Pedantry
Can anybody help me? I have Python 3(7, 8 and 9) installed, and all their three IDLEs used to appear in the Edit with IDLE (and they are in the registries). I did the steps above and reset which app opens the file by default (3.7 python.exe file cause was the first one that I installed), but that didn't work for me, unfortunately. I saw that the .exe that opens .py files in the registry is the pythonw.exe, WHY???. Is it correct? What can be wrong? I faced the exact same problem as many of you: the "Edit with IDLE" disappeared from the windows context menu after a while. What do I do?Laureen
@Laureen I'm sorry I don't use IDLE any more so I am not going to be able to help youDownwind
@Mark Ch, don't worry at all! Thank you so much for trying to help anyway! I appreciate it. At least, I can still open it with IDLE with not problems, so it's ok. Thanks for being willing to help!Laureen
Wow! Such an easy fix! To be completely honest, I was getting very irritated that the Python icon was not next to the files and, even though I don't use IDLE, I was annoyed that the option was missing. Instantly smiled when I saw the icon pop up. Many thanks.Tithonus
B
24

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!

Brink answered 5/8, 2017 at 16:1 Comment(5)
This totally fixed by problem, no need registry changes after all. It's important to pick the Python icon with the rocket icon.Sumption
I also noticed that the install location of the Python default app with the rocket icon is located in C:\Windows\py.exe, which is why I couldn't find it (different from the IDLE install folder or python.exe).Sumption
This totally helped! Thanks a lot! Without any difficulty, I was able to do this!!Ourself
I don't get to choose Python with rocket icon in that menu: imageVolcano
@sortai I uninstalled Python, removed any leftovers and freshly installed againVolcano
A
15

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\""
Augur answered 21/3, 2015 at 6:1 Comment(1)
In my case this some how dosent work. Maybe because i got ArcGIS installed? But it worked after changing the same commands in the other path [HKEY_CLASSES_ROOT\pyfile\shell\Edit with IDLE\command]Amphipod
F
3

Another option would be to just open the file with the idle by choosing open with:

C:\Python27\ArcGIS10.3\Lib\idlelib\idle.bat 

as the default program.

Fragile answered 1/7, 2016 at 16:38 Comment(1)
This is not recommended because the ProgId will be changed. This might be one of the reasons they dont have "Edit with IDLE" option. bugs.python.org/issue29014Firebrand
S
3

I got the "Edit with IDLE" back with the option "Repair" of the deinstallation-menu.

Soundboard answered 22/10, 2018 at 2:26 Comment(0)
S
2

Adding a little more detail to Teodorico Levoff's answer for those who need a little more explanation, like myself.

Open a text editor, such as Notepad, and copy/paste the following, but be sure to modify the paths to pythonw.exe and idle.pyw so that they match the paths in your own system:

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

Save this text file as idle.reg in the Python27 folder, so you now have a file that resembles this (with your own file path, of course):

C:\Python27\idle.reg

Right-click the idle.reg file, and in the context menu, click Merge. A couple instructions may appear or notices that require a Yes or Continue that I selected. In the end, my .py files give me the option to "Edit in IDLE" again.

I hope these explanations are helpful. Big thank you to those who've solved this problem before and shared there solutions.

Silage answered 21/3, 2015 at 6:37 Comment(0)
O
1

For opening your file in IDLE mode or in python exe mode u can follow this simple steps. Works for me in my windows 7 system. For IDLE mode:

  1. Select the file and press right mouse
  2. press open with---->choose default program
  3. press browse and go to the folder where your python programm is installed
  4. in python folder search IDLE and select the batch file
  5. press open and your file will be open in IDLE edit mode

For python.exe mode:

  1. In command prompt write "where python"
  2. copy the path from cmd
  3. Select the file and press right mouse
  4. press open with---->choose default program
  5. press browse and go to the selected path
  6. press open and your file will be open in IDLE edit mode
Owenism answered 2/7, 2022 at 7:51 Comment(1)
useful if python was installed through Windows app storeKalidasa
U
0

As click to save button to save your python code there will be Two Extensions...1) .py and 2) .pyw.

So for Python 2 you have to save python program using extension .pyw.

Uproar answered 31/1, 2017 at 13:17 Comment(0)
P
0

I think the majority of cases are caused by the Py launcher that comes with Python 3. When you install Python 3 alongside Python 2.x, the *.py and *.pyw files are associated to run with the new Py launcher. Since *.py and *.pyw files are no longer associated with Python.exe, that breaks the "Edit with IDLE" and similar context menu options, despite all relevant registry entries being present and correct.

Right clicking a file and choosing Python.exe and selecting "always use the selected program to open this kind of file" option fixes the problem (even if Python.exe seems to be already set as the default program) but then you lose the Py launcher functionality. This may well be considered a bug with the Python 3.x installer and I think should be fixed at that level by the Python developers.

Meanwhile, I'm sure registry wizards can find a workaround for this but unfortunately, that's beyond me at the moment.

Passageway answered 16/8, 2017 at 9:24 Comment(0)
U
0

I followed Teodorico Levoff's directions above, as well as Abyx's from the following page: https://superuser.com/questions/280636/trying-to-edit-a-python-file-but-the-edit-with-idle-has-disappeared-when-i-rig

However, it only works partially. When I right-click on a .py file, no 'Edit with IDLE' shows up. Choosing 'Edit' opens the file with IDLE. Also, the python icon is not associated with .py files. I decide to associate it with Notepad, then associate it with Python again. That works the magic. The icon is back, and so is the 'Edit with IDLE' option. Hope it helps.

Ursine answered 9/10, 2017 at 4:19 Comment(0)
V
-1

This issue is arising because of the problem in the registry of Python installation. While one may edit the registry and resolve the issue, the simple solution for this can be:

  1. DELETE ALL THE REGISTRIES pertaining to the py extensions and

  2. Re-install Python and let installation take its course of action.

The problem will definitely resolve.

Happy Programming

Varitype answered 21/12, 2017 at 23:38 Comment(0)
C
-1

After uninstalling both 2.7 and 3.6, reinstalling 3.6, I ran the init.py ,main.py, and idle.pyw found in C:\Program Files\python\Lib\idlelib and the edit with menu reappeared

Canned answered 28/6, 2018 at 20:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.