Python 获取windows下所有进程Id 和名称, 并关闭excel进程
import psutilimport osdef printPids(): pids = psutil.pids() for pid in pids: try: p = psutil.Process(pid) print('pid-%s,pname-%s' % (pid, p.name())) ...