From the help:
"When a script is run inside a tool from an ArcGIS application or from another geoprocessing script, the environment settings used by the calling application or script are passed to it. These settings become the default settings used by the tool's script when it is executed. The called script may alter the settings passed to it, but those changes are only used within that script or by any other tool it may call."The environmental settings are exposed as properties on the env class. These properties can be used to retrieve the default values and to set custom values.
Setting Workspace Example:
>>> import arcpy
>>> from arcpy import env
>>> env.workspace = "c:/data"
To get a python list of all envrionmental values do the following:
>>> import arcpy
>>> print arcpy.ListEnvironments()
You can load and save envrionmental settings to a file using the
>>> # Load settings
>>> arcpy.LoadSettings(file)
>>> # Save Settings
>>> arcpy.SaveSettings(saveFile)
Enjoy