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,操作更方便 ...
随机推荐
- 【DataStructure In Python】Python实现各种排序算法
使用Python实现直接插入排序.希尔排序.简单选择排序.冒泡排序.快速排序.归并排序.基数排序. #! /usr/bin/env python # DataStructure Sort # Inse ...
- IPv6 tutorial 2 New features: Routing
https://4sysops.com/archives/ipv6-part-2-new-features-routing/ Routing路由选择 In the last post of my IP ...
- hadoop异常:java.lang.RuntimeException: java.lang.NoSuchMethodException
出现异常的程序大致框架是这样的: public class getMaxTemperature extends Configured implements Tool { ... class MaxTe ...
- c#基础这些你都看过吗?(一)-----仅供初学者使用
1.注释(不写注释是流氓,名字瞎起是扯淡)‘///’一般用于注释函数,注释类.2.快捷键ctrl+k+d(有语法错误无法进行对齐)ctrl+j(快速弹出只能提示)shift+end,shift+hom ...
- 全新 D 系列虚拟机型号
Kenaz KwaAzure计算运行时项目经理 今天,我们宣布将发布名为D系列的Windows Azure 新VM型号,并支持虚拟机和 Web/Worker Role.这些虚拟机型号最多可以提供 11 ...
- [WebKit]浏览器的加载与页面性能优化
非常棒.非常系统的一份资料,值得阅读! 原文来自百度泛用户体验. 作者:nwind 本文将探讨浏览器渲染的loading过程,主要有2个目的: 了解浏览器在loading过程中的实现细节,具体都做了什 ...
- 使用Apache 的lib进行List、Set、数组之间的转换(转)
使用Apache Jakarta Commons Collections: import org.apache.commons.collections.CollectionUtils; String[ ...
- 正则表达式(来源http://deerchao.net/tutorials/regex/regex.htm)
目录 跳过目录 本文目标 如何使用本教程 正则表达式到底是什么东西? 入门 测试正则表达式 元字符 字符转义 重复 字符类 分枝条件 反义 分组 后向引用 零宽断言 负向零宽断言 注释 贪婪与懒惰 处 ...
- SAE网站搭建(1)
用了半天时间,把Django的基本结构同步到SAE上了,里边比较麻烦的地方如下: 1. 数据库的同步; SAE用的是SQL数据库,默认使用下面的用户名.密码等变量(SAE为我们做了很多工作) 首先需要 ...
- [POJ3684]Physics Experiment
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1363 Accepted: 476 Special Judge ...