I am learning how to use Python to create scripts that are run in ArcMap (10.1). The code below has the user pick the folder where the shapefiles are located, then goes through the shapefiles to create a Value Table of only those shapefiles that start with "landuse".
I am unsure of how to add a row to the value table, because the values are being selected in an argument, and the folder cannot be put directly into the code. See code below...
#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(??)