The solution to the .py file icon is white paper and the right button does not have Edit with IDLE

Table of contents

1. The .py file is the icon as white paper

1. First find the installation path of your own python

2. Right-click to open the setting to open with → select other applications:

2 Solve the problem that the right button of the .py file does not have edit with idle

1. Win+R input regedit to enter the registry editor

2. Add right-click menu items

3. Set the key value of shell and Edit with IDLE to Edit with IDLE, and set the key value of command to the installation path of python and idle

4. Bind the execution program for this entry


1. The .py file is the icon as white paper

Right-click to open the way, set python as the default way to open, use pythonw.exe

1. First find the installation path of your own python

2. Right-click to open the setting to open with → select other applications:

 The icon returns to normal as shown below:

 

2 Solve the problem that the right button of the .py file does not have edit with idle

1. Win+R input regedit to enter the registry editor

First win+R, enter regedit to enter the registry editor, find HKEY_CLASSES_ROOT\SystemFileAssociations.py, if there is no .py folder, create a new one, and create a new item according to the structure shown in the figure (I created a new one here, and there was no . py item)

2. Add right-click menu items

HKEY_CLASSES_ROOT\SystemFileAssociationsCreate this item in :

.py\shell\Edit with IDLE\command

Create the following image:

 

3. Set Edit with IDLEthe key values ​​of shell and key to Edit with IDLE, and set the key value of command to the installation path of python and idle

Check your installation path:

  • Find the shortcut to idle (a python folder will be created in the start menu when python is installed)

  • Then check the properties-shortcut-target, copy the path of the target column, paste it into the command key value of the registry, and click OK.

Note: Everyone's installation location is different, and I am using the python environment that comes with anaconda

My python environment path in anconda here is:

 

4. Bind the execution program for this entry

Change the default value in the newly created item, ie HKEY_CLASSES_ROOT\SystemFileAssociations\.py\shell\Edit with IDLE\command, and modify it to the two paths found earlier:

I am here for anaconda:

C:\Users\86157\anaconda3\pythonw.exe "C:\Users\86157\anaconda3\Lib\idlelib\idle.pyw" -e "%1"

Or locally installed python environment:

"D:\Python37\pythonw.exe" "D:\Python37\Lib\idlelib\idle.pyw" -e "%1"

If the directory where Python is installed is different, modify it accordingly

After completing the above operations, right-click the .py file, you can see the Edit with IDLE option, and it can be opened successfully. 

 

Guess you like

Origin blog.csdn.net/weixin_46474921/article/details/123798239