CheckProduct

摘要

Checks to see if the requested license is available.

语法

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

Product code for the product being checked.

  • arcviewArcView product code.
  • arceditorArcEditor product code.
  • arcInfoArcInfo product code.
  • engineEngine Runtime product code.
  • enginegeodbEngine Geodatabase Update product code.
  • arcserverServer product code.
String
返回值
数据类型说明
String

There are five possible return values for CheckProduct:

  • AlreadyInitalized License has already been set in the script.
  • Available The requested license is available to be set.
  • Unavailable The requested license is unavailable to be set.
  • NotLicensed The requested license is not valid.
  • Failed A system failure occurred during the request.

代码示例

CheckProduct example

Check to see if an ArcInfo license is available.

import arcpy
from arcpy import env
import sys

env.workspace = "C:/Data/World.gdb"
if arcpy.CheckProduct("ArcInfo") == "Available":
    arcpy.PolygonToLine_management("Lakes", "LakeLines")
else:
    print "ArcInfo license not available"
    sys.exit("ArcInfo license not available")

相关主题


7/10/2012