ListTables
汇总
返回当前工作空间中的表格列表。
讨论
如果工作空间中存在数据库视图,它们将在表列表中返回。
必须先设置工作空间环境,然后才能使用多个列表函数,包括 ListDatasets 、 ListFeatureClasses 、 ListFiles 、 ListRasters 、 ListTables 和 ListWorkspaces 。
语法
ListTables({wild_card}, {table_type})
| 参数 | 说明 | 数据类型 | ||||||
|---|---|---|---|---|---|---|---|---|
|
wild_card |
限制返回的结果。如果未指定某一值,则返回所有值。通配符不区分大小写。
|
* |
||||||
|
table_type |
The table type to limit the results.
(默认值为 All) |
String |
返回值
| 数据类型 | 说明 |
|---|---|
|
String |
该函数返回的列表包含受可选 |
代码示例
ListTables 示例
列出工作空间中的所有表名称。
import arcpy
# Set the current workspace
arcpy.env.workspace = "c:/data/mydata.gdb"
# Get and print a list of tables
tables = arcpy.ListTables()
for table in tables:
print(table)