import win32pdh aa=win32pdh.EnumObjectItems(None,None,'process',win32pdh.PERF_DETAIL_WIZARD)
aa的返回值:
(['% Processor Time', '% User Time', '% Privileged Time', 'Page Faults/sec', 'Working Set Peak', 'Working Set', 'Page File Bytes Peak', 'Page File Bytes', 'Private Bytes', 'Thread Count', 'Priority Base', 'Elapsed Time', 'ID Process', 'Creating Process ID', 'Pool Paged Bytes', 'Pool Nonpaged Bytes', 'Handle Count', 'IO Read Operations/sec', 'IO Write Operations/sec', 'IO Data Operations/sec', 'IO Other Operations/sec', 'IO Read Bytes/sec', 'IO Write Bytes/sec', 'IO Data Bytes/sec', 'IO Other Bytes/sec', 'Working Set - Private'], ['Idle', 'System', 'smss', 'csrss', 'csrss', 'wininit', 'winlogon', 'services', 'lsass', 'lsm', 'svchost', 'svchost', 'LogonUI', 'svchost', 'svchost', 'svchost', 'svchost', 'ZhuDongFangYu', 'svchost', 'spoolsv', 'svchost', 'EngineServer', 'FrameworkService', 'VsTskMgr', 'mfevtps', 'sqlservr', 'naPrdMgr', 'TCPSVCS', 'snmp', 'sqlwriter', 'Mcshield', 'mfeann', 'conhost', 'IMECMNT', 'svchost', 'SearchIndexer', 'csrss', 'winlogon', 'taskhost', 'taskeng', 'rdpclip', 'MacTray', 'dwm', 'explorer', 'shstat', '360tray', 'QQ', 'TXPlatform', 'sogoupinyintray', 'chrome', 'chrome', 'chrome', 'chrome', 'chrome', 'rundll32', 'chrome', 'OUTLOOK', 'OSPPSVC', 'Pythonwin', 'chrome', 'MSACCESS', 'chrome', 'hh', 'svchost', 'svchost', 'mscorsvw', 'chrome', '_Total'])
需要先安装pywin32
python for windows 获取进程列表 part2 (自学备注)
最新推荐文章于 2023-08-07 23:46:44 发布