Did I find the right examples for you? yes no

All Samples(9)  |  Call(9)  |  Derive(0)  |  Import(0)
Return a list of current running PIDs.

        def pids():
    """Return a list of current running PIDs."""
    return _psplatform.pids()
        


src/p/s/psutil-2.1.1/test/test_psutil.py   psutil(Download)
    raise_at = time.time() + timeout
    while 1:
        if pid in psutil.pids():
            # give it one more iteration to allow full initialization
            time.sleep(0.01)
    def test_pid_exists_2(self):
        reap_children()
        pids = psutil.pids()
        for pid in pids:
            try:
                # if it is no longer in psutil.pids()
                time.sleep(.1)
                if pid in psutil.pids():
                    self.fail(pid)
        pids = range(max(pids) + 5000, max(pids) + 6000)
    def test_pids(self):
        plist = [x.pid for x in psutil.process_iter()]
        pidlist = psutil.pids()
        self.assertEqual(plist.sort(), pidlist.sort())
        # make sure every pid is unique
        self.assertEqual(sorted(d.keys()), ['exe', 'name'])
 
        p = psutil.Process(min(psutil.pids()))
        d = p.as_dict(attrs=['connections'], ad_value='foo')
        if not isinstance(d['connections'], list):

src/p/s/psutil-2.1.1/test/_windows.py   psutil(Download)
        wmi_pids = [x.ProcessId for x in w]
        wmi_pids.sort()
        psutil_pids = psutil.pids()
        psutil_pids.sort()
        if wmi_pids != psutil_pids:
    def test_zombies(self):
        # test that NPS is raised by the 2nd implementation in case a
        # process no longer exists
        ZOMBIE_PID = max(psutil.pids()) + 5000
        for name, _ in self.fun_names:

src/p/s/psutil-2.1.1/test/_posix.py   psutil(Download)
        # remove ps subprocess pid which is supposed to be dead in meantime
        pids_ps.remove(p.pid)
        pids_psutil = psutil.pids()
        pids_ps.sort()
        pids_psutil.sort()