一、上代码
import psutil for proc in psutil.process_iter(): try: pinfo = proc.as_dict(attrs=[‘pid‘, ‘name‘]) except psutil.NoSuchProcess: pass else: print(pinfo)
二、效果:
标签:src style es2017 inf psu post port nbsp psutil
一、上代码
import psutil for proc in psutil.process_iter(): try: pinfo = proc.as_dict(attrs=[‘pid‘, ‘name‘]) except psutil.NoSuchProcess: pass else: print(pinfo)
二、效果:
标签:src style es2017 inf psu post port nbsp psutil
原文地址:http://www.cnblogs.com/songxingzhu/p/8066799.html