AnsweredAssumed Answered

arcpy.describe in stand alone script

Question asked by rvburton Champion on Nov 18, 2017
Latest reply on Nov 20, 2017 by rvburton

Does Describe work differently in a stand-alone script vs. a script run inside ArcMap?  More specifically, does Describe use the workspace if one is specified?  Here's the script:

import arcpy

gdb = r'C:\Path\To\Default.gdb' # path to a file geodatabase
arcpy.env.workspace = gdb

for fc in arcpy.ListFeatureClasses("*"):
        desc = arcpy.Describe(fc)
        print "{} - {}".format(fc, desc.dataType)

Here's the folder structure:

File Structure

Note that there is a folder outside the file geodatabase with the same name as a feature inside it - in this case "point_fc".

Here are the results:

# Outside ArcMap in stand-alone script:
point_fc - Folder
line_fc - FeatureClass
polygon_fc - FeatureClass

# In ArcMap's Python window:
point_fc - FeatureClass
line_fc - FeatureClass
polygon_fc - FeatureClass

The stand-alone script picked up the folder, whereas the script when ran in ArcMap picked up the feature class.  Is this expected behavior for Describe?