I posted a similar question before, but I am trying to list all of the element types in the geodatabase, such as feature datasets, networks, rasters, domains, non-spatial tables, etc.
For rasters, I got the following code working.
#Get Raster datasets rasters = arcpy.ListRasters() for rs in rasters: arcpy.AddMessage(rs)
However, I was told that I should probably use
Walk function instead of
ListFeature function. The following is the the sample code I found, but was unable to find a way to print the result.
What change do I need to make to the following code to make it print results?
workspace = "c:/data" rasters =  walk = arcpy.da.Walk(workspace, topdown=True, datatype="RasterDataset") for dirpath, dirnames, filenames in walk: # Disregard any folder named 'back_up' in creating list of rasters if "back_up" in dirnames: dirnames.remove('back_up') for filename in filenames: rasters.append(os.path.join(dirpath, filename))