Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Return users currently connected on the system as a list of
namedtuples including the following fields.

 - user: the name of the user
 - terminal: the tty or pseudo-tty associated with the user, if any.
 - host: the host name associated with the entry, if any.
 - started: the creation time as a floating point number expressed in
   seconds since the epoch.

        def users():
    """Return users currently connected on the system as a list of
    namedtuples including the following fields.

     - user: the name of the user
     - terminal: the tty or pseudo-tty associated with the user, if any.
     - host: the host name associated with the entry, if any.
     - started: the creation time as a floating point number expressed in
       seconds since the epoch.
    """
    return _psplatform.users()
        


src/p/s/psutil-2.1.1/examples/who.py   psutil(Download)
def main():
    users = psutil.users()
    for user in users:
        print_("%-15s %-15s %s  (%s)" % (
            user.name,

src/p/s/psutil-2.1.1/test/test_psutil.py   psutil(Download)
    def test_users(self):
        users = psutil.users()
        self.assertNotEqual(users, [])
        for user in users:
            assert user.name, user
        check(psutil.disk_partitions())
        check(psutil.disk_usage(os.getcwd()))
        check(psutil.users())
 
 

src/p/s/psutil-2.1.1/test/_posix.py   psutil(Download)
        self.assertEqual(len(users), len(psutil.users()))
        terminals = [x.split()[1] for x in lines]
        for u in psutil.users():
            self.assertTrue(u.name in users, u.name)
            self.assertTrue(u.terminal in terminals, u.terminal)