pwd --- The password database — Dokumentasi Python 3.15.2
Navigasi index modul | berikut | sebelum | Python » 3.15.2 documentation » The Python standard library » Unix-specific services » pwd --- The password database | Tema | pwd --- The password database ¶ This module provides access to the Unix user account and password database. It is available on all Unix versions. Availability : Unix, not WASI, not iOS. Password database entries are reported as a tuple-like object, whose attributes correspond to the members of the passwd structure (Attribute field below, see <pwd.h> ): Indeks Atribut Artinya 0 pw_name Nama login 1 pw_passwd Optional encrypted password 2 pw_uid Numerical user ID 3 pw_gid Numerical group ID 4 pw_gecos User name or comment field 5 pw_dir User home directory 6 pw_shell User command interpreter The uid and gid items are integers, all others are strings.
KeyError is raised if the entry asked for cannot be found. Catatan In traditional Unix the field pw_passwd usually contains a password encrypted with a DES derived algorithm. However most modern unices use a so-called shadow password system. On those unices the pw_passwd field only contains an asterisk ( '*' ) or the letter 'x' where the encrypted password is stored in a file /etc/shadow which is not world readable. Whether the pw_passwd field contains anything useful is system-dependent.
It defines the following items: pwd. getpwuid ( uid ) ¶ Return the password database entry for the given numeric user ID. pwd. getpwnam ( name ) ¶ Return the password database entry for the given user name. pwd. getpwall ( ) ¶ Return a list of all available password database entries, in arbitrary order. Lihat juga Modul grp An interface to the group database, similar to this. Topik sebelumnya posix --- The most common POSIX system calls Topik berikutnya grp --- The group database This page Report a bug Improve this page Show source Show translation source « Navigasi index modul | berikut | sebelum | Python » 3.15.2 documentation » The Python standard library » Unix-specific services » pwd --- The password database | Tema | © Hak cipta 2001 Python Software Foundation.
Halaman ini dilisensikan di bawah Lisensi Python Software Foundation Versi 2. Contoh, resep, dan kode lainnya dalam dokumentasi juga dilisensikan di bawah Lisensi Zero Clause BSD. Lihat Sejarah dan Lisensi untuk informasi lebih lanjut. Python Software Foundation adalah sebuah korporasi nirlaba. Mari berdonasi. Terakhir diperbarui pada Nov 19, 2026 (08:48 UTC). Menemukan kekutu ? Dibuat menggunakan Sphinx 9.1.1.