说明:本示例代码使用最简单的python语法,简要介绍如何使用Python做ArcGIS二次开发。适合初学者阅读。
# -*- coding: utf-8 -*-
import arcpy
import os
input_folder = "H:\\Original\\qhnu\\wangxch20170318\\MAP"
fileExtent = [".shp",".tif",".tiff",".img"]
for files in os.walk(input_folder ):
for filename in files[2]:
for Extent in fileExtent:
if filename.endswith(Extent):
inputData = files[0] + "\\" + filename
oupPutData = files[0].replace("wangxch20170318","modif") + "\\r" + filename
print inputData,oupPutData
if os.path.exists(files[0].replace("wangxch20170318","modif")) == False:
os.mkdir(files[0].replace("wangxch20170318","modif"))
if Extent == ".shp":
arcpy.Pr