Files
markbench-tests/harness_utils/process.py
derek-hirotsu 59c0b7eb6d update workflow (#67)
* update workflow

* update file path

* fix action error

* fix step id

* revert test change

* test

* test

* fix newline

* run poetry install

* fix error

* install poetry

* test

* revert poetry install

* test calling pylint as module

* test calling pylint as module
2023-10-17 18:33:47 -07:00

11 lines
346 B
Python

"""Functions related to managing processes"""
import psutil
def terminate_processes(*process_names: str) -> None:
"""Finds given process names and terminates them"""
for name in process_names:
for process in psutil.process_iter():
if name.lower() in process.name().lower():
process.terminate()
# test