Python os.getgid() method

Python os.getgid() method returns the real group ID of the current process.

Python | os.getgid() and os.setgid() method

setgid() and getgid() methods are present in the OS module. OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system-dependent functionality. 

All functions in the os module raise OSError in 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.

Note: os.setgid() and os.getgid() methods are available only on UNIX platforms.

Similar Reads

Python os.getgid() method

Python os.getgid() method returns the real group ID of the current process....

Syntax

os.getgid()...

Python os.setgid() method

...

Syntax

Python os.setgid() method sets the real group ID of the current process to a specified value. Below is the syntax of os.setgid() function....