The grp module provides access to the UNIX group database.
Returns the group database entry for a group ID, gid. The returned object is a group structure with the following attributes:
gr_name—The group name
gr_passwd—The group password (if any)
gr_gid—The integer group ID
gr_mem—A list of usernames in the group
The returned object also behaves like a 4-tuple (gr_name, gr_passwd, gr_gid, gr_mem). Raises KeyError if the group doesn’t exist.
Same as getgrgid(), but looks up a group by name.
Returns all available group entries as a list of tuples as returned by getgrgid().
pwd (p. 332)