最新下载
热门教程
- 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 7
 - 8
 - 9
 - 10
 
python根据pid杀死相应进程的教程
时间:2022-06-24 15:07:13 编辑:袖梨 来源:一聚教程网
用python语言实现根据pid杀死相应进程
kill_process.py代码如下
| 代码如下 | 复制代码 | 
#! /usr/bin/python # -*- coding: utf-8 -*- importos importsys importsignal defkill(pid): try: a=os.kill(pid, signal.SIGKILL) # a = os.kill(pid, signal.9) # 与上等效 print'已杀死pid为%s的进程, 返回值是:%s'%(pid, a) exceptOSError, e: print'没有如此进程!!!' if__name__=='__main__': kill(8132)  | |
ok, Enjoy it !!!
相关文章
- 过山车之星2游乐园声誉提升方法分享 11-04
 - 过山车之星2独特景点作用介绍说明 11-04
 - 炉石传说标准模式轮盘术卡组推荐分享 11-04
 - 炉石传说标准小行星萨卡组推荐分享 11-04
 - 炉石传说基尔加丹轮盘术卡组推荐分享 11-04
 - 炉石传说宇宙彩虹DK高胜率卡组推荐分享 11-04