1
저는 ArcMap (10.1)에서 실행되는 스크립트를 작성하기 위해 Python을 사용하는 방법을 배우고 있습니다. 아래 코드는 사용자가 쉐이프 파일이 위치한 폴더를 선택한 다음 쉐이프 파일을 통해 "landuse"로 시작하는 쉐이프 파일 만의 값 테이블을 만듭니다.Python에서 값 테이블 (ArcPy)에 행을 추가하려면 어떻게합니까?
값이 인수에서 선택되고 폴더를 코드에 직접 넣을 수 없기 때문에 값 테이블에 행을 추가하는 방법을 잘 모르겠습니다. for
루프에서
#imports
import sys, os, arcpy
#arguments
arcpy.env.workspace = sys.argv[1] #workspace where shapefiles are located
#populate a list of feature classes that are in the workspace
fcs = arcpy.ListFeatureClasses()
#create an ArcGIS desktop ValueTable to hold names of all input shapefiles
#one column to hold feature names
vtab = arcpy.ValueTable(1)
#create for loop to check for each feature class in feature class list
for fc in fcs:
#check the first 7 characters of feature class name == landuse
first7 = str(fc[:7])
if first7 == "landuse":
vtab.addRow() #****THIS LINE**** vtab.addRow(??)