Often encounter, double-click the. py file can not run, or right-click the item without idle editing, in the WIN7 system is more common.
Double-clicking the *.py file does not work:
Right-click Open with, select Default Programs, browse to find and select Python.exe
Right-click does not have an idle workaround:
1. If the Python environment is set up soon, PYTHONPATH, and the Lib/site-packages directory does not have many library files, you can reload
2. Modify the registration form,
I. Modify the registry by using the Regedit command
The code is as follows:
[Hkey_classes_root\python.file\shell\editwithidle]
[Hkey_classes_root\python.file\shell\editwithidle\command]
Ii. Modifying the registry by batch file
The code is as follows:
Windows Registry Editor Version 5.00
[Hkey_classes_root\python.file\shell\editwithidle]
@= "&edit with IDLE"
[Hkey_classes_root\python.file\shell\editwithidle\command]
@= "\" c:\\python27\\pythonw.exe\ "\" c:\\python27\\lib\\idlelib\\idle.pyw\ "-e \"%1\ ""
Save the above file to Python.reg, double click, will also modify the registry, restart effective
Note: replace it with your own Python installation directory.