GetSystemEnvironment (arcpy)
Summary
Gets the specified system environment variable value, such as "TEMP".
Discussion
When using GetSystemEnvironment to retrieve the "TEMP" environment variable's value, GetSystemEnvironment will cycle through "TEMP", "TMP" and "MW_TMPDIR" environment variables and return the first value it finds.
Syntax
GetSystemEnvironment (environment)
Parameter | Explanation | Data Type |
environment |
The name of the system environment variable. | String |
Data Type | Explanation |
String |
Returns the value of the specified system environment variable as a string. |
Code Sample
GetSystemEnvironment example
Return the specified system environment variable value.
import arcpy
# Set the scratchWorkspace environment to the value returned
# from the system environment variable TEMP
arcpy.env.scratchWorkspace = arcpy.GetSystemEnvironment("TEMP")
Related Topics
3/3/2014