Hello.
Is there a way to pass multiple search terms (or wildcards as described in the documentation) to the arcpy function ListTables? I've tried passing in a comma separate list of strings and passing in an array of strings. Neither of those approaches worked.
I need to work with all the tables that start with 'Ad' and those that start with 'T'. What i am doing now is calling the ListTables function twice (see below). This gets the results I need, but it seems very heavy - i have to go to the workspace twice to get the list i'm after:
Solved! Go to Solution.
No.
ListTables—ArcGIS Pro | Documentation
concatenating the lists is fine even if one of the lists is empty
q = ['a', 'b']
q0 = []
q + q0
['a', 'b']
you can use a list comprehension to make it look a tad better
table_lst = [arcpy.ListTables(i) for i in ["PES.IPM.Ad*", "PES.IPM.T*"]]
No.
ListTables—ArcGIS Pro | Documentation
concatenating the lists is fine even if one of the lists is empty
q = ['a', 'b']
q0 = []
q + q0
['a', 'b']
you can use a list comprehension to make it look a tad better
table_lst = [arcpy.ListTables(i) for i in ["PES.IPM.Ad*", "PES.IPM.T*"]]