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.

link|improve this question
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
feedback

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

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

1 Answer

up vote 1 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\""
link|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
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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