On this page
grp.struct_group
Prev: grp.getgrnam | Up: grp
Rel: grp.getgrall, grp.getgrgid, grp.getgrnam
Ref: docs.python.org โ grp.struct_group
Tags: #public #python3 #stdlib #grp
Import
import grp
from grp import struct_group
Signature & Overview
grp.struct_group(iterable=(), /)
grp.struct_group: Results from getgr*() routines.
Methods & Attributes
struct_group.count(self, value, /)โ Return number of occurrences of value.struct_group.index(self, value, start=0, stop=9223372036854775807, /)โ Return first index of value.
Usage
import grp
import os
entry = grp.getgrgid(os.getgid())
assert isinstance(entry, grp.struct_group) and isinstance(entry.gr_mem, list)
Gotchas
gr_memonly lists supplementary members: Users whose primary GID matches the group may not appear ingr_mem.
REPL Inspect
from grp import struct_group
help(struct_group)
Linked from
Related notes
- tuts/python3/stdlib_module/grp/getgrall Linked here; links to this page; shared tags: #grp, #stdlib
- tuts/python3/stdlib_module/grp/getgrgid Linked here; links to this page; shared tags: #grp, #stdlib
- tuts/python3/stdlib_module/grp/getgrnam Linked here; links to this page; shared tags: #grp, #stdlib
- tuts/python3/stdlib_module/grp Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib