打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
python

Your question is not too clear, but If I assume that you are about to launch a process wich goes to zombie and you want to be able to control that in some state of your script. If this in the case, I propose you the following:

p = subprocess.Popen([cmd_list], shell=False)

This in not really recommanded to pass through the shell.I would suggest you ti use shell=False, this way you risk less an overflow.

# Get the process id & try to terminate it gracefulypid = p.pid()p.terminate()# Check if the process has really terminated & force kill if not.try:    os.kill(pid, 0)    p.kill()    print "Forced kill"except OSError, e:    print "Terminated gracefully"
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
python 模块psutil获取进程信息
python 判断linux进程,并杀死进程
在shell中模拟”Ctrl+...“的控制操作
Linux Shell脚本实现根据进程名杀死进程
使用 Python 实现多进程
Python实现多进程的四种方式!详细介绍
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服