arcgis 获得路径和环境变量信息
import arcpy
import sys
import os
import string
reload(sys)
sys.setdefaultencoding("utf8")
scratchWS = arcpy.env.scratchWorkspace
arcpy.AddMessage("默认地理数据库路径:" + scratchWS)
scriptPath = sys.path[0];
arcpy.AddMessage("系统路径:" + scriptPath)
toolSharePath = os.path.dirname(scriptPath)
arcpy.AddMessage("路径:" + toolSharePath)
scratchWS = arcpy.GetSystemEnvironment("TEMP")
arcpy.AddMessage("临时:" + toolSharePath)
arcpy.AddMessage(arcpy.GetMessages())
environments = arcpy.ListEnvironments()
########################################################
#
environments.sort(key=string.lower)
for environment in environments:
# As the environment is passed as a variable, use Python's getattr
# to evaluate the environment's value
#
envSetting = getattr(arcpy.env, environment)
# Format and print each environment and its current setting
#
arcpy.AddMessage( "{0:<30}: {1}".format(environment, envSetting))
结果:
默认地理数据库路径:C:\Users\Administrator\Documents\ArcGIS\Default.gdb
系统路径:D:\
路径:D:\
临时:D:\
autoCommit : 1000
cartographicCoordinateSystem : None
cellSize : MAXOF
coincidentPoints : MEAN
compression : LZ77
configKeyword : None
derivedPrecision : HIGHEST
extent : None
geographicTransformations : None
maintainSpatialIndex : False
mask : None
MDomain : None
MResolution : None
MTolerance : None
newPrecision : SINGLE
outputCoordinateSystem : None
outputMFlag : Same As Input
outputZFlag : Same As Input
outputZValue : None
projectCompare : NONE
pyramid : PYRAMIDS -1 NEAREST DEFAULT 75
qualifiedFieldNames : True
randomGenerator : 0 ACM599
rasterStatistics : STATISTICS 1 1
referenceScale : None
scratchWorkspace : C:\Users\Administrator\Documents\ArcGIS\Default.gdb
snapRaster : None
spatialGrid1 : 0.0
spatialGrid2 : 0.0
spatialGrid3 : 0.0
terrainMemoryUsage : False
tileSize : 128 128
tinSaveVersion : CURRENT
workspace : C:\Users\Administrator\Documents\ArcGIS\Default.gdb
XYDomain : None
XYResolution : None
XYTolerance : None
ZDomain : None
ZResolution : None
ZTolerance : None
Completed script 脚本...
成功 在 Sat Nov 16 08:28:26 2013 (经历的时间: 1.00 秒)
arcgis 获得路径和环境变量信息的更多相关文章
- Windows 系统下设置Nodejs NPM全局路径和环境变量配置
在nodejs的安装目录中找到node_modules\npm\.npmrc文件 修改如下即可: prefix = D:\tool\nodejs\node_globalcache = D:\tool\ ...
- NX二次开发-UFUN获取环境变量路径,将环境变量转换为字符串,字符串拼接UF_translate_variable
NX9+VS2012 #include <uf.h> UF_initialize(); //UFUN获取环境变量路径 //将环境变量转换为字符串 char* GetName = NULL; ...
- C#当前应用程序路径及环境变量
一.获取当前文件的路径 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName 获取模块的完整路径.可获得当前执行的 ...
- C#.net 获取当前应用程序所在路径及环境变量
一.获取当前文件的路径 string str1=Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名. string st ...
- 【C#学习笔记】获取当前应用程序所在路径及环境变量
转自:http://www.cnblogs.com/netlyf/archive/2011/06/22/2086718.html 一.获取当前文件的路径 string str1=Process.Get ...
- C#获取当前应用程序所在路径及环境变量
一.获取当前文件的路径 string str1=Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名. string st ...
- C#读取“我的文档”等特殊系统路径及环境变量
返回“我的文档”路径字符串 Environment.GetFolderPath(Environment.SpecialFolder.Personal) 本技巧使用GetFolderPath方法来获取指 ...
- (转载)C#获取当前应用程序所在路径及环境变量
一.获取当前文件的路径 string str1=Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名. string st ...
- jdk的下载路径和环境变量的配置
一:jdk百度网盘的下载路径: 链接:https://pan.baidu.com/s/1pF41oGcTqouULsWKEBn3hw 提取码:p1y2 复制这段内容后打开百度网盘手机App,操作更方便 ...
随机推荐
- 添加service到SystemService硬件服务
添加service到SystemService: 添加硬件服务. 创建时间:2015年3月9日(星期一) 晚上11:07 | 分类:硬件驱动Android | 天气: 修改时间:2015年3月10日( ...
- DesignPatterns
1.设计模式,说明工厂模式. 总共23种,分为三大类:创建型,结构型,行为型 创建型 1. Factory Method(工厂方法) 2. Abstract Factory(抽象工厂) 3. Bui ...
- Understanding Memory Management(2)
Understanding Memory Management Memory management is the process of allocating new objects and remov ...
- eclipse 代码中突然出现特殊字符
在写代码的时候,不知道点到了 eclipse 的哪个属性,代码中就出现了一些特殊字符,也不能删除. 请问,在 eclipse 中该怎么设置,才能将这些字符去掉. 如下图所示: 解决方法: 选择Wind ...
- Linux kernel ‘qeth_snmp_command’函数缓冲区溢出漏洞
漏洞名称: Linux kernel ‘qeth_snmp_command’函数缓冲区溢出漏洞 CNNVD编号: CNNVD-201311-423 发布时间: 2013-11-29 更新时间: 201 ...
- BZOJ2843: 极地旅行社
2843: 极地旅行社 Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 90 Solved: 56[Submit][Status] Descripti ...
- $apply() $digest()
理解Angular中的$apply()以及$digest() <!DOCTYPE html> <html> <head> <meta charset=&quo ...
- jQuery与XML
jQuery与XML 快而强的遍历系统,华丽丽的选择器语法,这或许是jQuery 那么流行的原因.当然它还有详尽的文档.它主要是用来处理HTML的,但在这里妳会看到如何应用到XML. 使用jQuery ...
- 用BigDecimal类实现Fibonacci算法
Fibonacci(N)=Fibonacii(N-1)+Fibonacci(N-2) 其中 Fibonacci(0)=0;Fibonacci(1)=1 用循环或则递归实现Fibonacci算法很简单, ...
- Linux内核系列设备模型(一) Kobject与Kset
1.Kobject Kobject是设备驱动模型的核心结构,它使所有设备在底层都有统一的接口.在内核注册的kobject对象都会对应sysfs文件系统中的一个目录(目录名称有Kobject结构中k_n ...