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 获得路径和环境变量信息的更多相关文章

  1. Windows 系统下设置Nodejs NPM全局路径和环境变量配置

    在nodejs的安装目录中找到node_modules\npm\.npmrc文件 修改如下即可: prefix = D:\tool\nodejs\node_globalcache = D:\tool\ ...

  2. NX二次开发-UFUN获取环境变量路径,将环境变量转换为字符串,字符串拼接UF_translate_variable

    NX9+VS2012 #include <uf.h> UF_initialize(); //UFUN获取环境变量路径 //将环境变量转换为字符串 char* GetName = NULL; ...

  3. C#当前应用程序路径及环境变量

    一.获取当前文件的路径 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName 获取模块的完整路径.可获得当前执行的 ...

  4. C#.net 获取当前应用程序所在路径及环境变量

    一.获取当前文件的路径 string str1=Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名. string st ...

  5. 【C#学习笔记】获取当前应用程序所在路径及环境变量

    转自:http://www.cnblogs.com/netlyf/archive/2011/06/22/2086718.html 一.获取当前文件的路径 string str1=Process.Get ...

  6. C#获取当前应用程序所在路径及环境变量

    一.获取当前文件的路径 string str1=Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名. string st ...

  7. C#读取“我的文档”等特殊系统路径及环境变量

    返回“我的文档”路径字符串 Environment.GetFolderPath(Environment.SpecialFolder.Personal) 本技巧使用GetFolderPath方法来获取指 ...

  8. (转载)C#获取当前应用程序所在路径及环境变量

    一.获取当前文件的路径 string str1=Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名. string st ...

  9. jdk的下载路径和环境变量的配置

    一:jdk百度网盘的下载路径: 链接:https://pan.baidu.com/s/1pF41oGcTqouULsWKEBn3hw 提取码:p1y2 复制这段内容后打开百度网盘手机App,操作更方便 ...

随机推荐

  1. MySql定位执行效率较低的SQL语句

    MySQL能够记录执行时间超过参数 long_query_time 设置值的SQL语句,默认是不记录的. 获得初始锁定的时间不算作执行时间.mysqld在SQL执行完和所有的锁都被释放后才写入日志.且 ...

  2. REST Web 服务介绍

    在项目上使用到了Rest技术,应该是Rest的服务概念才对.主要是对外(BPM)暴露API来提供Service.推荐一篇有质量的文章,接下来会系统一点的学习一下Restful概念.http://kb. ...

  3. 自动测试框架(by myself)

    这段日子以来一直在自动话测试,然后关于框架一直有个很模糊的概念,通过N多人的解说,这个应该不能算是一个框架,但是还是很模糊 如下图是我自己认为的框架,不知道是否正确(请大侠们多多指点) 1.用nuni ...

  4. Loadrunner执行Java脚本

    1. Eclipse中调试Java脚本,脚本调试通过后,打成jar包: 2. 新建lr脚本,选择Java vuser协议: 3. Run-time Settings中Classpath设置jar包,没 ...

  5. 浏览器兼容性的css hack 写法

    IE各版本浏览器之间的识别概括如下: IE6:能识别 * .\9 和 _ ,不能识别 !important IE7:能识别 * .\9 和 !important,不能识别 _ IE8:能识别 \9 和 ...

  6. 原来DataTable的Distinct竟如此简单![转]

    本文转自:http://www.cnblogs.com/BlueFly/archive/2009/01/08/1372151.html 有时我们需要从DataTable中抽取Distinct数据,以前 ...

  7. 成都Uber优步司机奖励政策(2月3日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  8. poj 2117 Electricity【点双连通求删除点后最多的bcc数】

    Electricity Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4727   Accepted: 1561 Descr ...

  9. openCV 2.4.13 iOS background_segm.hpp 'list' file not found

    最近下载了最新版的OpenCV的Framework. 导入到项目里边,编译.然后就出现了问题 /opencv2.framework/Headers/video/background_segm.hpp: ...

  10. 版本控制Subversion TortoiseSVN apache VisualSVN笔记(转载)

    转载于http://blog.sina.com.cn/s/blog_6b94d5680101m7ah.html Subversion(简称svn)是近年来崛起的版本管理软件,是cvs的接班人.目前,绝 ...