Is it possible to set arcpy.env.workspace multiple times in the same script to ListDataFeatures from different workspaces?
eg.
import arcpy
def readFromGdb():
arcpy.env.workspace = "C:/data/base.gdb"
gdbList = listFeatureClasses()
#do the work
def readFromShp():
arcpy.env.workspace = "C:/data_shp/"
shpList = listFeatureClasses()
#do the work
Best Answer
If 10.1+, you can use arcpy.da.Walk and not touch the global arcpy environments:
Otherwise, I usually do this to avoid any surprises later on: