Title: Theory / Unimportant / CS / Programming / Python / Lib / 16.1 os
Tags: FromInstruction computer_to_instruction hasNotNewEffectReturnsMeaning automatedNewLineAfterCommaSpace

Instruction: os
Page: https://docs.python.org/3.3/library/os.html
Effect: This module provides a portable way of using operating system dependent functionality.
Language: Python

Instruction: OSError
Page: https://docs.python.org/3.3/library/os.html
Language: Python
Returns: Error for the case of invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system.

Instruction: ctermid()
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the filename corresponding to the controlling terminal of the process.
Assuming: Unix

Instruction: environ
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: A mapping object representing the string environment when os is loaded

Instruction: environb
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: A byte string version of environ

Instruction: fsencode(foo)
Page: https://docs.python.org/3/library/os.html
Effect: Encode path-like filename to the filesystem encoding with 'surrogateescape' error handler, or 'strict' on Windows
Language: Python
Context: os
Returns: foo as bytes unchanged.

Instruction: fsdecode(foo)
Page: https://docs.python.org/3/library/os.html
Effect: decode path-like filename to the filesystem encoding with 'surrogateescape' error handler, or 'strict' on Windows
Language: Python
Context: os
Returns: foo as str unchanged.

Instruction: getenv(
  key,
  default=None
)
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the value of the environment variable key if it exists, or default if it doesn’t
Typ: String

Instruction: getenvb(
  key,
  default=None
)
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the value of the environment variable key if it exists, or default if it doesn’t
Assuming: supports_bytes_environ is True.
Typ: Bytes

Instruction: get_exec_path(env=None)
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the list of directories that will be searched for a named executable, similar to a shell, when launching a process.
env, when specified, should be an environment variable dictionary to lookup the PATH in. By default, when env is None, environ is used.

Instruction: getegid()
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the effective group id of the current process. This corresponds to the “set id” bit on the file being executed in the current process.

Instruction: geteuid()
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the current process’s effective user id.

Instruction: getgid()
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the real group id of the current process.

Instruction: getgrouplist(user,group)
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: List of group ids that user belongs to.
If group is not in the list, it is included; typically, group is specified as the group ID field from the password record for user.

Instruction: getgroups()
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: List of supplemental group ids associated with the current process.

Instruction: getlogin()
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the name of the user logged in on the controlling terminal of the process

Instruction: getpgid(pid)
Page: https://docs.python.org/3/library/os.html
Language: Python
Context: os
Returns: the process group id of the process with process id pid. If pid is 0, the process group id of the current process is returned.