Skip to main content

Command

汇总

将地理处理工具作为单个字符串运行。

讨论

旧版本:

在 ArcGIS 10 中,引入了 Python 窗口以取代 命令行 窗口。 与用逗号分隔参数的 Python 不同, Command 函数使用与原始 命令行 窗口相同的语法(即用空格分隔参数)。

语法

Command(command_line)

参数 说明 数据类型

command_line

The double-quoted string representing the tool to be run.

String

返回值

数据类型 说明

String

由换行符 ('\n') 隔开的地理处理工具消息。 如果工具运行失败,将仅返回错误消息。

代码示例

命令示例

运行加双引号的命令行字符串。

import arcpy

# Set current workspace and define command line command.
arcpy.env.workspace = "c:/data/florida.gdb"
command_string = "Clip_analysis Runways DadeCounty DadeRunways"

# Run command line string
arcpy.Command(command_string)