Search code examples
pythonwindowsregedit

"Edit with IDLE" not showing with a .pyw file


I recently changed Python version, but "Edit with IDLE" was not shown when you right clicked on a Python file.

So I headed down into Regedit and changed this:

regedit

In both Python.File\Shell\Edit with IDLE 3.8 (64-bit) and Python.NoConFile\Shell\Edit with IDLE 3.8 (64-bit), the file in command is filled with this:

"C:\Users\PC\AppData\Local\Programs\Python\Python38\pythonw.exe" -m idlelib "%L" %*

But the "Edit with IDLE" option is only shown with a .py file.


With a .py file:

.py

With a .pyw file:

.pyw

So my question is: Why doesn't Edit with IDLE show with .pyw files?

I tried reinstalling Python after completely removing it, rebooting (to see Regedit changes?) but nothing worked.
Any ideas?


Edit: HKEY_CLASSES_ROOT\.py refers to HKEY_CLASSES_ROOT\Python.File and HKEY_CLASSES_ROOT\.pyw refers to HKEY_CLASSES_ROOT\Python.NoConFile (didn't change that).


Solution

  • Finally I solved the problem myself.

    In fact, the description of a .pyw file in the Explorer was "PYW file", so it wasn't attached to the .pyw in Regedit.

    I don't know why, but because I attached the .pyw extension to

    C:\Users\PC\AppData\Local\Programs\Python\Python38\pythonw.exe
    

    it wasn't attached to .pyw in Regedit.

    So I simply clicked on "Open with" and chose

    C:\Windows\pyw.exe
    

    And everything worked.


    Edit:

    I don't know why, but because I attached the .pyw extension to

     C:\Users\PC\AppData\Local\Programs\Python\Python38\pythonw.exe
    

    it wasn't attached to .pyw in Regedit.

    The Python38 folder just didn't exist, I had to type Python38-32