python 获取所有进程列表并杀死指定进程
代码语言:python
所属分类:其他
代码描述:python 获取所有进程列表并杀死指定进程
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
#!/usr/local/python3/bin/python3 # -*- coding: utf-8 -* import psutil import os import signal print("----------------------------- show all processes info --------------------------------") # show processes info pids = psutil.pids() for pid in pids: p = psutil.Process(pid) # get process name according to pid process_name = p.name() print("Process name is: %s, pid is: %s" %(process_name, pid)) print("---.........完整代码请登录后点击上方下载按钮下载查看
网友评论0