These functions and data items provide information and operate on the current process and user.
environ['HOME']
is the pathname of your home directory (on some
platforms), and is equivalent to getenv("HOME")
in C.
If the platform supports the putenv() function, this mapping may be used to modify the environment as well as query the environment. putenv() will be called automatically when the mapping is modified.
If putenv() is not provided, this mapping may be passed to the appropriate process-creation functions to cause child processes to use a modified environment.
When putenv() is
supported, assignments to items in os.environ
are automatically
translated into corresponding calls to putenv(); however,
calls to putenv() don't update os.environ
, so it is
actually preferable to assign to items of os.environ
.
(sysname, nodename, release, version,
machine)
. Some systems truncate the nodename to 8
characters or to the leading component; a better way to get the
hostname is socket.gethostname()
or even
socket.gethostbyaddr(socket.gethostname())
.
Availability: recent flavors of Unix.