Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My IDLE shortcut in the right click menu has disappeared. I think it's because I used to use Python 2.7, but I installed Python 2.5 without uninstalling Python2.7, and then uninstalled Python 2.5. I found one file named idle.bat, and it works, but that isn't a good way to solve this problem.

share|improve this question

migrated from stackoverflow.com Oct 6 '11 at 7:15

This question came from our site for professional and enthusiast programmers.

    
I though this is because I installed two Python in my computer, then I remove one. Maybe I should try keyword like "How to insert shortcut into right-click menu". Anyway thanks for your help. –  Jimmy Oct 6 '11 at 3:35
    
That probably is the reason it went missing, but your question is how to fix it –  Michael Mrozek Oct 6 '11 at 4:23

2 Answers 2

up vote 2 down vote accepted

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\""
share|improve this answer
    
Hi, I used another way to add the right-click command, but it apply to all my files. Actually, I just want to apply to *.py file. How can I delete the right-click command I added before ? Then I can add your command. Thank you. –  Jimmy Oct 6 '11 at 11:19
    
@Jimmy: You can use regedit to inspect HKCR\*\shell, HKCR\*\shellex, HKCR\AllFilesystemObjects\shellex, and so on. This is tedious if you don't find the culprit quickly. Or try a a context menu editor such as ShellMenuView and ShellExView. –  eryksun Oct 6 '11 at 12:03
    
Hi, I find the command in the redgit and delete, but I still can't add the right-click command by these two command. I don't know why. I just want to add the command on the right-click menu of *.py and *.pyw file. Thanks again. –  Jimmy Oct 7 '11 at 8:27
    
@Jimmy: When you save the above to say idle.reg and right-click the file idle.reg, do you see the option 'Merge'? If that seems to work fine and you confirm that the settings were added, then open a command prompt and check that the output of assoc .py is .py=Python.File. –  eryksun Oct 7 '11 at 10:52
    
Hi,actually I didn't see the idle.pyw. I see the idle.bat, so I replace idle.bat with idle.pyw. –  Jimmy Oct 11 '11 at 9:57

This worked for me:


(Also view: edit with idle (python gui) context menu windows-7)

  1. open regedit
  2. go to [HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command], if it doesn't exist create it.
  3. copy the following line into the registry:

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

  4. go to [HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command], if it doesn't exist create it.

  5. copy the same line in the the registry:

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

Note: if your python path is different (e.g. c:/program files/...) then change the paths to match the pythonw.exe and idle.pyw file locations.

This should also work for a clean ActivePython install (to give you that classic idle feel!).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.