CheckProduct (arcpy)

摘要

检查申请的许可是否可用。

语法

CheckProduct (product)
参数说明数据类型
product

Product code for the product being checked.

  • arcviewArcGIS for Desktop Basic product code
  • arceditorArcGIS for Desktop Standard product code
  • arcinfoArcGIS for Desktop Advanced product code
  • engineEngine Runtime product code
  • enginegeodbEngine Geodatabase Update product code
  • arcserver Server product code
String
返回值
数据类型说明
String

CheckProduct 函数,有五个可能的返回值:

  • AlreadyInitalized 已在脚本中设置许可。
  • Available 申请的许可存在,可以设置。
  • Unavailable 申请的许可不存在,无法设置。
  • NotLicensed 申请的许可无效。
  • Failed 申请期间系统错误。

代码实例

CheckProduct 示例

检查是否存在 ArcGIS for Desktop Advanced 许可。

import sys
import arcpy

arcpy.env.workspace = "c:/data/world.gdb"

if arcpy.CheckProduct("ArcInfo") == "Available":
    arcpy.PolygonToLine_management("Lakes", "LakeLines")
else:
    msg = 'ArcGIS for Desktop Advanced license not available'
    print(msg)
    sys.exit(msg)

相关主题

5/10/2014