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.