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 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.
os.getgroups() method in Python is used to get the list of supplementary group ids associated with the current process.
supplementary group IDs: In Unix systems, every user must be a member of at least one group called primary group. It is also possible for a user to be listed as member of additional groups in the relevant entries in the group database. The IDs of these additional groups are called supplementary group IDs
os.getgroups() method is available only on UNIX systems.
Parameter: No parameter is required
Return Type: This method returns a list which represents the supplementary group IDs associated with the current process
Supplementary group IDs associated with the current process: [4, 24, 27, 30, 46, 118, 128, 1000]
- Difference between Method Overloading and Method Overriding in Python
- class method vs static method in Python
- Python | next() method
- Python | set() method
- Python | os.dup() method
- Python | os.writev() method
- Python | os.getpgrp() method
- Python | os.setregid() method
- Python | os.pwrite() method
- Python | os.readlink() method
- Python | os.scandir() method
- Python | os.getpgid() method
- Python | os.tcgetpgrp() method
- Python | after method in Tkinter
- Python | os.getsid() method
- Python | os.nice() method
- Python | os.openpty() method
- Python | sys.getallocatedblocks() method
- Python PIL | blend() method
- Python | os.abort() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.