On this page
  1. pwd.struct_passwd
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

pwd.struct_passwd

Prev: pwd.getpwuid | Up: pwd
Rel: pwd.getpwall, pwd.getpwnam, pwd.getpwuid
Ref: docs.python.org โ€” pwd.struct_passwd
Tags: #public #python3 #stdlib #pwd


Import

import pwd
from pwd import struct_passwd

Signature & Overview

pwd.struct_passwd(iterable=(), /)

pwd.struct_passwd: Results from getpw*() routines.

Methods & Attributes

Usage

import os, pwd

entry = pwd.getpwuid(os.getuid())
assert isinstance(entry, pwd.struct_passwd) and hasattr(entry, "pw_shell")

Gotchas

REPL Inspect

from pwd import struct_passwd
help(struct_passwd)

Linked from

Related notes