首页 > 编程语言 >[934] Run the python file directly (ArcGIS Pro)

[934] Run the python file directly (ArcGIS Pro)

时间:2023-11-03 11:12:44浏览次数:55  
标签:Run ArcGIS python Pro Python file Python27 click

ref: The Edit with IDLE and Run with ArcGIS Pro options are not available in the context menu when right-clicking Python files


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.

Image of the 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

  1. Right-click the Python file, and select Properties.
  2. In the Properties window, click the General tab, and click the Change button next to Opens with:.
  3. In the Open with window, click the Browse button.
  4. 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
  1. Select python.exe, and click Open.
Image of the Open with... window
  1. 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.
  1. 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\""
  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
  1. Right-click the .reg file, and click Merge. Proceed to click Yes when prompted.

The following image displays the availability of Edit with IDLEEdit with IDLE (ArcGIS Pro), and Run with ArcGIS Pro options in the context menu.

Image of the Edit with IDLE and Run with ArcGIS Pro options are available in the context menu

 

标签:Run,ArcGIS,python,Pro,Python,file,Python27,click
From: https://www.cnblogs.com/alex-bn-lee/p/17807147.html

相关文章

  • 安装MySQL初始化问题由于找不到VCRUNTIME140_1.dll,无法继续执行代码。重新安装程序可
    1.关于安装MySQL初始化遇到的问题出现的是如下图错误 这是安装mysql-8.0.25初始化的时候我遇到的报错解决方法如下:安装微软常用运行库合集[下载地址,没有积分的可以评论区联系我](https://download.csdn.net/download/qq_42603590/19686518)安装好之后就不会报错了好了之......
  • Python selenium操作cookie
    如何使用Selenium处理Cookie,今天彻底学会了(qq.com)"""1.学习目标:掌握selenium对cookie操作2.语法2.1获取所有cookiedriver.get.cookies()返同列表格式字典类型[{},{},{}]2.2添加cookiedriver.add_cookie(参数)参数:字典格......
  • 使用Python SimpleHTTPServer 快速启动http服务
    当前Python版本为2.7,3.5以后的版本略有区别,可用$python--version查看Python版本1、进入需要分享的目录cd~2、开启http服务#当前运行不填写端口默认8000python-mSimpleHTTPServer8888#当前终端后台运行python-mSimpleHTTPServer8888&#完全后台运行n......
  • myfileserver
    1.nmap扫描网段找出靶机,靶机ip:192.168.224.133 2.namp-A192.168.224.133全面扫描靶机开启的端口有21,22,80,111,445,2049,2121。其中21对应的ftp服务允许匿名登录,22对应的ssh连接是以ssh-key方式验证的,2121对应ftp也可以匿名登录尝试顺序:21,2121,80,445,22。 3.进入ftp权限太......
  • 启动nginx报错nginx: [emerg] unexpected end of file, expecting "}" in /usr/local/
    启动nginx报错:“nginx:[emerg]unexpectedendoffile,expecting“}”in/usr/local/nginx/conf/nginx.conf:118”重启nginx时,报这么个错:[root@localhostconf]#/usr/local/nginx/sbin/nginx-sreloadnginx:[emerg]unexpectedendoffile,expecting“}”in/usr/lo......
  • Python 正则表达式(RegEx)指南
    正则表达式(RegEx)是一系列字符,形成了一个搜索模式。RegEx可用于检查字符串是否包含指定的搜索模式。RegEx模块Python中有一个内置的包叫做re,它可以用于处理正则表达式。导入re模块:importrePython中的RegEx,一旦导入了re模块,您就可以开始使用正则表达式了。示例:搜索......
  • Python 正则表达式(RegEx)指南
    正则表达式(RegEx)是一系列字符,形成了一个搜索模式。RegEx可用于检查字符串是否包含指定的搜索模式。RegEx模块Python中有一个内置的包叫做re,它可以用于处理正则表达式。导入re模块:importrePython中的RegEx,一旦导入了re模块,您就可以开始使用正则表达式了。示例:搜索......
  • Android FileProvider的一些事
    高版本的android对文件权限的管控抓的很严格,理论上两个应用之间的文件传递现在都应该是用FileProvider去实现,这篇博客来一起了解下它的实现原理。首先我们要明确一点,FileProvider就是一个ContentProvider,所以需要在AndroidManifest.xml里面对它进行声明:<providerandroid:......
  • 在Python中,如何从子类调用父类的方法是?
    内容来自DOChttps://q.houxu6.top/?s=在Python中,如何从子类调用父类的方法是?在Python中创建一个简单的对象层次结构时,希望能够从派生类调用父类的方法。在Perl和Java中,有一个关键字可以做到这一点(super)。在Perl中,我可能会这样做:packageFoo;subfrotz{return"Bamf"......
  • 代码随想训练营第二十三天(Python)| 669. 修剪二叉搜索树 、108.将有序数组转换为二叉搜
    669.修剪二叉搜索树树的修剪方式赋值。1、递归法classSolution:deftrimBST(self,root:Optional[TreeNode],low:int,high:int)->Optional[TreeNode]:ifrootisNone:returnNoneifroot.val<low:returnself.tr......