SysUtils.py 文件源码

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

项目:PINCE 作者: korcankaraokcu 项目源码 文件源码
def search_in_processes_by_name(process_name):
    """Searches currently running processes and returns a list of psutil.Process objects corresponding to processes that
    has the str process_name in them

    Args:
        process_name (str): Name of the process that'll be searched for

    Returns:
        list: List of psutil.Process objects corresponding to the filtered processes
    """
    processlist = []
    for p in psutil.process_iter():
        if re.search(process_name, p.name(), re.IGNORECASE):
            processlist.append(p)
    return processlist


#:tag:Processes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号