摘要: 如何使用Python来检查数据是否存在? 内容:
# 引入COM库 from win32com.client import Dispatch # 创建geoprocessor对象,并设置工作空间属性 GP = Dispatch("esriGeoprocessing.GPDispatch.1") GP.Workspace = "E:/UsingPython/SanDiego.mdb" # 判断数据是否存在 fc = "E:/UsingPython/SanDiego.mdb/Freeways" if GP.Exists(fc): print fc + " data is exists!" if not GP.Exists (fc+"aa"): print "FeatureClass " + fc + "aa" + "is not exists!"
1 个回复
易智瑞技术支持
赞同来自:
内容:
# 引入COM库 from win32com.client import Dispatch # 创建geoprocessor对象,并设置工作空间属性 GP = Dispatch("esriGeoprocessing.GPDispatch.1") GP.Workspace = "E:/UsingPython/SanDiego.mdb" # 判断数据是否存在 fc = "E:/UsingPython/SanDiego.mdb/Freeways" if GP.Exists(fc): print fc + " data is exists!" if not GP.Exists (fc+"aa"): print "FeatureClass " + fc + "aa" + "is not exists!"
创建时间:2006-01-06
最近更新:2006-01-06
【原文链接】
http://support.esrichina.com.cn/2006/0106/208.html
要回复问题请先登录或注册