import win32pdh def get_processes(): win32pdh.EnumObjects(None, None, win32pdh.PERF_DETAIL_WIZARD) #instances 是所有的进程名称 junk, instances = win32pdh.EnumObjectItems(None,None,'Process', win32pdh.PERF_DETAIL_WIZARD) proc_dict = {} #建立进程状态字典并更新进程状态 for in…