1、打開注冊表(Windows+R,輸入regedit回車)

2、在注冊表中找到
HKEY_CLASSES_ROOT\SystemFileAssociations
該路徑下的.py,如果沒有則自己創建
\.py\shell\Edit with IDLE\command

將command的值設置為:
"C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python36-32\\pythonw.exe" "C:\\Users\\admin\\AppData\\Local\\Programs\\Python\\Python36-32\\Lib\\idlelib\\idle.pyw" -e "%1"
(以上是python的安裝路徑,根據情況自行修改)

