Command

摘要

Executes a geoprocessing tool as a single string.

讨论

旧版本旧版本:

At ArcGIS 10, the Python window was introduced to replace the Command Line window. The Command function uses the syntax as used by the original Command Line, that is, parameters separated by spaces, unlike Python which separates parameters with commas.

语法

Command (command_line)
参数说明数据类型
command_line

The double-quoted string representing a command line command that is to be executed.

String
返回值
数据类型说明
String

The geoprocessing tool messages, separated by a newline ('\n'). If the tool fails, only the error messages are returned.

代码示例

Command example

Execute double-quoted command line string.

import arcpy
from arcpy import env

# Set current workspace and define command line command.
#
env.workspace = "C:/Data/Florida.gdb"
commandString = "Clip_analysis Runways DadeCounty DadeRunways"

# Execute command line string
arcpy.Command(commandString)

相关主题


7/10/2012