[934] Run the python file directly (ArcGIS Pro)
Description
In some instances, when right-clicking Python files, the 'Edit with IDLE' and 'Run with ArcGIS Pro' options are not available in the context menu.
Cause
The following are the possible causes:
- The default app to open the Python files has changed.
- The registry keys are not available.
Solution or Workaround
Select one of the options below depending on the cause to resolve the issue.
Select python.exe as the default application to open Python files
- Right-click the Python file, and select Properties.
- In the Properties window, click the General tab, and click the Change button next to Opens with:.
- In the Open with window, click the Browse button.
- In the Open with… window, paste the following path in the address bar, and press Enter.
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
- Select python.exe, and click Open.

- Close the Properties window.
Add the registry keys
Warning: The instructions below include making changes to essential parts of the operating system. Esri recommends performing a backup of the operating system and files, including the registry, before proceeding. Esri cannot guarantee results from incorrect modifications while following these instructions. Exercise caution. Consult a qualified computer system professional if necessary.
Note: Replace Python27 and ArcGIS10.7 with the appropriate versions if needed.
- Open a text editor such as Notepad, and copy the following command to the text editor:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command] @="\"C:\\Python27\\ArcGIS10.7\\pythonw.exe\" \"C:\\Python27\\ArcGIS10.7\\Lib\\idlelib\\idle.pyw\" -e \"%1\"" [HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command] @="\"C:\\Python27\\ArcGIS10.7\\pythonw.exe\" \"C:\\Python27\\ArcGIS10.7\\Lib\\idlelib\\idle.pyw\" -e \"%1\""
- Save the file as a .reg file in the Python folder. In this example, the file is saved in the Python27 folder. By default, the location is as follows:
C:\Python27
- Right-click the .reg file, and click Merge. Proceed to click Yes when prompted.
The following image displays the availability of Edit with IDLE, Edit with IDLE (ArcGIS Pro), and Run with ArcGIS Pro options in the context menu.

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
2015-11-03 【173】双显示器随便切换位置