S15qkd/qkd_globals.py
def kill_process_by_name(process_name: str):
    '''
    Searches processes by name and kills them.
    '''
    list_of_process_objects = []
    # Iterate over the all the running process
    for proc in psutil.process_iter():
        try:
            pinfo = proc.as_dict(attrs=['pid', 'name', 'create_time'])
            # Check if process name contains the given name string.
            if process_name.lower() in pinfo['name'].lower():
                list_of_process_objects.append(pinfo)
                psutil.Process(pinfo['pid']).kill()
        except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
            pass
    return list_of_process_objects

    Searches processes by name and kills them.
    
Searches processes by name and kills them.
Searches processes by name and kills them .
def kill_process_by_name(process_name: str):
    list_of_process_objects = []
    for proc in psutil.process_iter():
        try:
            pinfo = proc.as_dict(attrs=['pid', 'name', 'create_time'])
            if process_name.lower() in pinfo['name'].lower():
                list_of_process_objects.append(pinfo)
                psutil.Process(pinfo['pid']).kill()
        except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
            pass
    return list_of_process_objects
def kill_process_by_name ( process_name : str ) : list_of_process_objects = [ ] for proc in psutil . process_iter ( ) : try : pinfo = proc . as_dict ( attrs = [ 'pid' , 'name' , 'create_time' ] ) if process_name . lower ( ) in pinfo [ 'name' ] . lower ( ) : list_of_process_objects . append ( pinfo ) psutil . Process ( pinfo [ 'pid' ] ) . kill ( ) except ( psutil . NoSuchProcess , psutil . AccessDenied , psutil . ZombieProcess ) : pass return list_of_process_objects
Searches processes by name and kills them.
Searches processes by name and kills them .
'''
    Searches processes by name and kills them.
    ''' # Iterate over the all the running process # Check if process name contains the given name string.
process_name
str