Good morning everyone,I am working on trying to figure out how to create a list of full-path geodatabases that are inside a user-given folder. I would like it to be able to look down into any number of subfolders to find geodatabases ( I.E. if the main folder is "D:\Data\, I would like it to find a geodatabase that is located in "D:\Data\this\is\my\deep\subfolder\path\something.gdb" ). I currently have it working to pick up all personal databases by using regular expression matching, but the file geodatabases are giving me a lot of trouble. Here is the code that I have so far:for root, dirname, filenames in os.walk ( folder ):
for file in filenames:
if ( re.match ( "([A-Za-z0-9_]*).gdb", file ) ):
geodatabases.append ( os.path.join ( root, file ) )
elif ( re.match ( "([A-Za-z0-9_]*).mdb", file ) ):
geodatabases.append ( os.path.join ( root, file ) )
What its doing is that it will find all of the files that are in the file geodatabase folder (which are conveniently named *.gdbindex and such, which are caught by my regular expression) and put those in the list. I just want it to be able to figure out that it is a file geodatabase and put the path of the geodatabase in the list.Thank you for your time!Jeremy