如何双击运行含有arcpy模块的python程序
时间:2011-11-08
来源:互联网
arcpy是ArcGIS模块。我想双击运行python,然后把python程序放在Windows计划任务里可以每天执行。所以双击运行很重要,但如果程序里含有import arcpy后就不可以双击运行了。举个最简单的例子,
import os, shutil
shutil.rmtree('C:\Documents and Settings\Desktop\New Folder 1\info')
这个程序可以双击运行,但我加上arcpy后就不可以双击运行了,但这个程序在IDLE中是可以运行的。
import os, shutil, arcpy
shutil.rmtree('C:\Documents and Settings\yao.shen\Desktop\New Folder 1\info')
是不是我还有设置什么路径呢?谢谢!
import os, shutil
shutil.rmtree('C:\Documents and Settings\Desktop\New Folder 1\info')
这个程序可以双击运行,但我加上arcpy后就不可以双击运行了,但这个程序在IDLE中是可以运行的。
import os, shutil, arcpy
shutil.rmtree('C:\Documents and Settings\yao.shen\Desktop\New Folder 1\info')
是不是我还有设置什么路径呢?谢谢!
作者: rainbowyao1230 发布时间: 2011-11-08
我找到解决办法了:
When you try to launch a script automatically by double-clicking it, it's possible you'll get a message saying Windows doesn't know which program to use to open your file. If this happens to you, use the Browse button on the error dialog box to browse to the Python executable, most likely located in C:\Python26\ArcGIS10.0\Python.exe. Make sure Always use the selected program to open this kind of file is checked and click OK. Windows now understands that .py files should be run using Python.
When you try to launch a script automatically by double-clicking it, it's possible you'll get a message saying Windows doesn't know which program to use to open your file. If this happens to you, use the Browse button on the error dialog box to browse to the Python executable, most likely located in C:\Python26\ArcGIS10.0\Python.exe. Make sure Always use the selected program to open this kind of file is checked and click OK. Windows now understands that .py files should be run using Python.
作者: rainbowyao1230 发布时间: 2011-11-08
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28