Process Parameters
These functions and data items provide information and operate on the current process and user:
-
chdir(path) Changes the current working directory to
path. Availability: Macintosh, Unix, Windows.-
environ A mapping representing the string environment. For example,
environ['HOME']is the pathname of your home directory, equivalent togetenv("HOME")in C.If the platform supports the
putenv()function, this mapping can modify the environment as well as query the environment.putenv()is called automatically when the mapping is modified.If
putenv()isn’t provided, this mapping can be passed to the appropriate process-creation functions to cause child processes to use a modified environment.-
getcwd() Returns a string representing the current working directory. Availability: Macintosh, Unix, Windows.
-
getegid() Returns the current process’s effective group ID. Availability: Unix.
-
geteuid() Returns the current process’s effective user ID. Availability: Unix.
-
getgid() Returns the current process’s group ID. Availability: Unix.
-
getpgrp() Returns the current process’s group ID. Availability: Unix.
-
getpid() Returns the current process ID. Availability: Unix, Windows.
-
getppid() Returns the parent’s process ID. Availability: Unix.
-
getuid() Returns the current process’s user ID. Availability: Unix.
-
putenv(varname,value) Sets the environment variable,
varname, to the string value. Such changes to the environment affect subprocesses started withos.system(),popen(), or ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access