Python: name 'SpeificFeatureClass' is not defined

3655
2
03-30-2015 11:58 AM
JoseSanchez
Occasional Contributor III

Hi all

I am getting this error when I try to process a specific Feature Class

for fc in fcList:

            print "Feature: " + fc

            #

            #

            # Process Process Feature Class X

            #

            if fc == 'SpecificFeatureClass':

                       .......

0 Kudos
2 Replies
DarrenWiens2
MVP Honored Contributor

Please post your entire non-working script and error message. There does not appear to be an error in what you've posted. For example, this works:

>>> arcpy.env.workspace = r'C:/junk'
... fcList = arcpy.ListFeatureClasses()
... for fc in fcList:
...    if fc == 'utms.shp':
...        print fc
...       
# returns utms.shp
0 Kudos
JoseSanchez
Occasional Contributor III

This is what I did and it works.

for fc in fcList:
            print "Feature: " + fc

            #
            #
            # Process Sewer Access Manhone
            #
            desc = arcpy.Describe(fc)
            fname = desc.Name
            print "Feature Name: " + fname
            if fname == "SpecificFeatureClass":

0 Kudos