I'm using a script to list datasets from multiple gdbs in ArcPy (to rename most datasets and gdbs). Which looks like this:
dir_gdbs = 'D:\\mypath' os.chdir(dir_gdbs) lista_gdbs = glob.glob('*.gdb') for i in lista_gdbs: gdb = (os.path.join(dir_gdbs,i)) arcpy.env.workspace = gdb lista_capas = arcpy.ListDatasets() for u in lista_capas: #do stuff
It works correctly but there are many gdbs to process and it is very slow. Most of its time is lost changing the workspace (
arcpy.env.workspace = gdb). Is there any way to list the datasets within each gdb without doing this?