"Change with IDLE" option is missing from the context menu

I have Python 2.7.5 that is installed with ArcGIS 10.2.2. When I first right-clicked on the .py script that I had previously written, he listed the "Change Using IDLE" option in the context menu. However, this option no longer appears when I right-click the .py file.

I read numerous topics regarding this issue and tried to execute some of them, such as changing / deleting registry keys, and then reinstalling / restoring software. At the moment, I'm not interested in using the IDE, although many will be happy to know that I intend to use the IDE later. Right now, the goal is to fix the problem, not to avoid and circumvent it.

I appreciate the help I have received from the online community in the past, and I am sure that someone will come with a solution for me.

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

+5
source share
9 answers

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

Here's the reg file for adding a command to edit using IDLE files for Python.File (.py) and Python.NoConFile (.pyw) files. This is for Python 2.7 installed in C: \ Python27, so replace the paths to pythonw.exe and idle.pyw that are relevant to your installation. Save it in a .reg file. Then right-click and select Combine.

Windows Registry Editor version 5.00

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

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

+7
source

In most cases when this problem occurs, people will read the answers, directing them to the Windows registry, often unnecessarily.

In most cases, a registry key

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

already exists and has the correct value, but it will be used only in the context of the context menu of the Windows shell if .py files are installed by default for opening with python.exe.

This is the first thing to check and solves the problem in most cases:

  • right click on .py file
  • open with ...
  • select the default program ...
  • tick always uses the selected program to open this type of file
  • select python.exe

This runs the script in the terminal, but also returns the file type in python.

Now check the right-click menu again.

+10
source

As a newer update for people who have a problem with lack of downtime in Windows 10 using Python 3.6 (64-bit).

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

The easiest way to fix this problem is to click the "Start" button, then go to Settings → System → Default Applications → “Select Default Applications by File Type”. Scroll down the page until you find the file type “.py” and click on the icon and select “Python” (there is a small rocket ship in the icon). This will change your default application to “Python.exe,” and the “edit with idle” context menu will reappear in your .py files.

Hope this helps!

+3
source

Adding a little more detail to Theodoriko Levoff, the answer is for those who need a little more explanation, such as me.

Open a text editor such as Notepad and copy / paste the following, but remember to change the paths to pythonw.exe and idle.pyw so that they match the paths on 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 now you have a file similar to this one (with your own file path, of course):

 C:\Python27\idle.reg 

Right-click the idle.reg file and select Merge from the context menu. A couple of instructions or notifications may appear for which you need to select “Yes” or “Continue” that I have selected. In the end, my .py files again give me the "Edit in IDLE" option.

I hope these explanations will be helpful. Many thanks to those who solved this problem earlier and shared their solutions there.

+1
source

Another option is to simply open the file with downtime by selecting open with:

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

as the default program.

0
source

Like a save button, to save python code, there will be Two Extensions ... 1) .py and 2) .pyw .

So, for Python 2, you need to save the python program using the .pyw extension.

0
source

I think most of the cases are caused by the Py launcher, which comes with Python 3. When you install Python 3 with Python 2.x, the * .py and * .pyw files are associated with starting with the new Py launcher, Since the files * .py and * .pyw are no longer associated with Python.exe, this violates the "Edit with IDLE" options and similar context menu options, despite the fact that all relevant registry entries are present and corrected.

Right-clicking on the file and choosing Python.exe and choosing the option “always use the selected program to open this type of file” fix the problem (even if Python.exe seems to be already installed as the default program), but then you lose the bundle functionality Py. This may well be considered a bug with the Python 3.x installer, and I think that at this level, Python developers should be fixed at that level.

Meanwhile, I am sure that registry wizards can find a workaround for this, but unfortunately, this is outside of me at the moment.

0
source

I followed the signs of Theodoriko Levoff above, as well as Abyx 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, "Edit with IDLE" does not appear. Selecting "Edit" opens the IDLE file. In addition, the python icon is not associated with .py files. I decided to link it to Notepad and then link it to Python again. It works magic. The icon is returned, and the option "Change using IDLE". Hope this helps.

0
source

This issue occurs because of a problem in the Python installation registry. Although you can change the registry and solve the problem, a simple solution to this could be:

  • DELETE ALL REGISTERS related to py and

  • Reinstall Python and let the installation take effect.

The problem will definitely be solved.

Happy programming

0
source

Source: https://habr.com/ru/post/1215802/


All Articles