def getgrall(): lib.setgrent() lst = [] while 1: p = lib.getgrent() if not p: break lst.append(_group_from_gstruct(p)) lib.endgrent() return lst