Edit with IDLE (Python GUI) context menu on Windows 7
Asked Answered
H

2

12

Under Windows XP I have a context menu entry "edit with IDLE" for Python source files. I tried to make this work under Windows 7 (32 bit) as well by setting the corresponding registry entries under

HKEY_LOCAL_MACHINE\SOFTWARE\.py\shellex\ContextMenuHandlers\

However without success - the context menu entry does not appear. How do I set a context menu entry for a specific file type in Windows 7?

Heywood answered 2/3, 2011 at 13:51 Comment(2)
Sorry, messed up the registry entry. This is the correct one: HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command with the value C:\Python26\pythonw.exe C:\Python26\Lib\idlelib\idle.pyw -n -e %1Heywood
Ok, here is at least a workaround via the SendTo-Menu: I added a link in "C:\Users\<username>\AppData\roaming\Microsoft\windows\SendTo" : "C:\Python26\pythonw.exe C:\Python26\Lib\idlelib\idle.pyw -n -e"Heywood
C
5

I spent some time trying to figure this out, and finally got it. I'm running Windows 7, but it should be the same for Windows Vista, Windows XP, etc.

  1. Uninstall Python
  2. Open registry (WINR, then type regedit and hit ENTER)
  3. CTRLF and type .py
  4. Each .py key you come across, delete it.
  5. Do this until it gives you the message: finished searching the registry. Repeat this process but changing the search for the following querys:

    • .pyw
    • python
    • python.exe
    • pythonw.exe
  6. Delete them all

  7. Log off from your user account
  8. Log back on
  9. Re-install Python
Corrade answered 6/3, 2012 at 22:15 Comment(0)
L
2

I installed Python 2.7 on Windows 7 and the context menu was created automatically by the installer. My first suggestion would be to try running the Python installer again to see if the context menu gets created automatically instead of adding it manually.

The registry entry had the same path as you indicate in your comment, and this was the command:

"C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1"

There are some minor differences in the command from what you posted, but I am not sure whether those would account for the context entry not appearing.

Lapsus answered 10/3, 2011 at 22:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.