I have path to layer or feature
How to check is table or feature class by arcpy?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
You may use Describe Object property dataType:
desc = arcpy.Describe("C:/base.gdb/test") if desc.dataType == 'FeatureClass': print 'fc' elif desc.dataType == 'Table': print 'table' else: print desc.dataType
Use the arcpy.List... functions. First have to set the env.workspace to the fgdb. Then use arcpy.ListTables() or arcpy.ListFeatureclasses(). Each of these returns a python list of the requested type. If the list is empty (len(list) == 0), then there is no thing of that type. Unfortunately there does not seem to be a higher level function like arcpy.ListContents() or something.