GetInstallInfo (arcpy)

サマリ

The GetInstallInfo function returns a Python dictionary that contains information on the installation type properties.

構文

GetInstallInfo ()
戻り値
データ タイプ説明
Dictionary

The function returns a Python dictionary containing the properties of the installation.

Keys

Values

SourceDir

Source directory

InstallDate

Date of installation

SPBuild

Service pack build (or N/A)

ProductName

Product installed (Desktop, Server, Engine)

BuildNumber

The build number

InstallType

The installation type (or N/A)

Version

The product version

SPNumber

Service pack build number (or N/A)

Installer

Account installed by

InstallDir

Installation location

InstallTime

Time of installation

GetInstallInfo's dictionary object keys

コードのサンプル

GetInstallInfo example

Return installation information.

import arcpy

# Use the dictionary iteritems to iterate through 
#   the key/value pairs from GetInstallInfo
d = arcpy.GetInstallInfo()
for key, value in d.iteritems():
    # Print a formatted string of the install key and its value
    #
    print("{:<13} : {}".format(key, value))
GetInstallInfo example 2

Return the product version.

import arcpy

print(arcpy.GetInstallInfo()['Version'])

関連トピック

4/26/2014