killtree.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:aquests 作者: hansroh 项目源码 文件源码
def kill (pid, including_parent = True):    
        try: 
            parent = psutil.Process(pid)
        except psutil.NoSuchProcess:
            return

        children = parent.children(recursive=True)
        for child in children:
            child.kill()
        psutil.wait_procs(children, timeout=5)
        if including_parent:
            parent.kill()
            parent.wait(5)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号