Trying to edit a python file but the "edit command" has disappeared all of a sudden when I right click the file.
How do I restore the edit command so I can continue working on my python files?
I am using Windows Vista.
Trying to edit a python file but the "edit command" has disappeared all of a sudden when I right click the file.
How do I restore the edit command so I can continue working on my python files?
I am using Windows Vista.
In Windows7 you can create the
HKEY_CLASSES_ROOT\SystemFileAssociations\.py\shell\edit\command
path and set its default value to
c:\python\pythonw.exe c:\python\Lib\idlelib\idle.pyw -e %1
I spent some time trying to figure this out. i finally got it. I'm running windows 7, but should be the same for vista, XP etc.
repeat this process but changing the search for the following querys:
.pyw
python
python.exe
pythonw.exe
What exactly do you mean by the right click "edit command"? How did you originally install python and run and edit python files, which editor etc?
Have you considered using an IDE? I find that for development using eclipse IDE with pyDev is really good. Either that or pyscripter is fairly well known - http://code.google.com/p/pyscripter/downloads/list
If you want to continue as you were, try re-installing python, each version comes bundles with the Python IDLE which I expect is what you were using. - http://www.python.org/getit/
Then it should come back. If that fails:
See some more links below for IDEs Editors etc:
http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
https://stackoverflow.com/questions/60784/poll-which-python-ide-editor-is-the-best
https://stackoverflow.com/questions/126753/is-there-a-good-free-python-ide-for-windows
Sounds like you're using Windows. You need to associate IDLE as the editor for .py files. I don't know about Windows 7 but with XP:
Edit
button and make sure the "Application used" box reads something like "C:\PythonXX\pythonw.exe" "C:\PythonXX\Lib\idlelib\idle.pyw" -e "%1" (replacing XX with your Python version.New
button, enter "Edit with IDLE" in the Action box and the same "Application used" string as above, then check the DDE
box.Right click on the file, choose Open with, select choose default program, and select python.
Warning, this will attempt to run whatever script you are trying to open from the command prompt (but you can just x this out).
After that, the computer should recognize the file as a python file and give you the "Edit with Idle" option again.
In your registry find this entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Python.File\shell\Edit with IDLE\command
and replace the path to pythonw.exe with the path of the version you want to use by default. I'm guessing this path might have been pointing to something that no longer exists for OP.
A program you recently installed or launched might have changed the file association. Here's how I fixed mine in Windows 7:
Save the text below into a .reg file using notepad and double-click on it.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command] @="\"C:\Python34\pythonw.exe\" \"C:\Python34\Lib\idlelib\idle.pyw\" -e \"%1\""
[HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command] @="\"C:\Python34\pythonw.exe\" \"C:\Python34\Lib\idlelib\idle.pyw\" -e \"%1\""
If you are using Python27 change the "34"s above to "27"s. Restart your computer.
Create following key if not exists:
HKEY_CLASSES_ROOT\*\shell\Edit with IDLE\command
Now set value to default as:
c:\Pythonxx\pythonw.exe c:\Pythonxx\Lib\idlelib\idle.pyw -e %1
Note: Replace xx
with version number of Python installed.
A program you recently installed or launched might have changed the file association. Here's how I fixed mine in Windows 7:
In Windows Explorer, right-click on your .py file and select "Properties".
In "General" tab under "Type of file:" click the "Change..." button.
Under "Recommended Programs" select "Python Launcher for Windows (Console)".
Above answer from rtseno only seems to work for .py files, not .pyw files.
P.S. I cant comment yet so i made this an answer.