1 Star 0 Fork 8

baocx/Landslide_Analysis

forked from Luoge/Landslide_Analysis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
util_batch_del_featrueClass.py 817 Bytes
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: utf-8 -*-
"""
批量删除要素文件
"""
import arcpy
def batDelFcClass(wildcard_str = "tmp_*"):
if wildcard_str is None or wildcard_str == "":
arcpy.AddMessage("wildcard cannot be empty!")
return None
data_lst = arcpy.ListFeatureClasses(wildcard_str)
for dd in data_lst:
# arcpy.AddMessage("Delete {0} starting...".format(dd))
arcpy.Delete_management(dd)
arcpy.AddMessage("Delete {0} successful!".format(dd))
if __name__ == "__main__":
# arcgis工具箱模式
wildcard_str = arcpy.GetParameterAsText(0)
wildcard_str = wildcard_str.strip()
batDelFcClass(wildcard_str)
# 代码模式
# arcpy.env.workspace = "G:/DataForDoctorPaper/博士论文数据.gdb"
# wildcard_str = "tmp_*"
# batDelFcClass(wildcard_str)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/baocx/Landslide_Analysis.git
git@gitee.com:baocx/Landslide_Analysis.git
baocx
Landslide_Analysis
Landslide_Analysis
master

搜索帮助