GetInstallInfo (arcpyproduction)

Resumen

Returns a data dictionary that contains information on the installation type properties for the current version of the Soluciones de Esri de representación cartográfica y representación en gráficos software installed on a particular machine.

Debate

A Python developer sometimes needs to get the exact version of the Soluciones de Esri de representación cartográfica y representación en gráficos software that is installed on a particular machine. This function returns a data dictionary of values, so you can limit your Python scripts to run only on a specific release of the software.

Sintaxis

GetInstallInfo ()
Valor de retorno
Tipo de datosExplicación
Dictionary

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

Keys

Values

SourceDir

Source directory

InstallDate

Date of installation

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

Ejemplo de código

GetInstallInfo example 1

Return installation information.

import arcpyproduction

# Use the dictionary iteritems to iterate through 
#   the key/value pairs from GetInstallInfo
d = arcpyproduction.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 arcpyproduction

print(arcpyproduction.GetInstallInfo()['Version'])
4/26/2014