macos_user.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:ClockworkVMs 作者: csd-dev-tools 项目源码 文件源码
def getUsers(self):
        """
        Return a list of users, from pwd.

        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>):

        Index    Attribute    Meaning
        0    pw_name    Login name
        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. 
        """
        self.users = pwd.getpwall()
        return self.users

    #----------------------------------------------------------------------
    # Getters
    #----------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号