• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

相对脚本位置查找数据

相对脚本位置查找数据

 

import arcpy
import os
import sys

# Get the pathname to this script
#
scriptPath = sys.path[0]
arcpy.AddMessage("Script folder: " + scriptPath)

# Get the pathname to the ToolShare folder
#
toolSharePath = os.path.dirname(scriptPath)
arcpy.AddMessage("ToolShare folder: " + toolSharePath)

# Now construct pathname to the ToolData folder
#
toolDataPath = os.path.join(toolSharePath, "ToolData")
arcpy.AddMessage("ToolData folder: " + toolDataPath)

# Create the pathname to the parks feature class found in the ToolData folder
#
parkPath = os.path.join(toolDataPath, "Project.gdb/Parks")
arcpy.AddMessage("Parks feature class: " + parkPath)

 

 

 

Script folder: F:\
ToolShare folder: F:\
ToolData folder: F:\ToolData
Parks feature class: F:\ToolData\Project.gdb/Parks
Completed script 脚本..

posted on 2011-05-27 11:34  gisai  阅读(159)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3