add docstring for process.get_processes_by_path

This commit is contained in:
Prodesire 2018-01-26 22:23:41 +08:00
parent b1d27fd122
commit f699b13945
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,9 @@ except ImportError:
def get_processes_by_path(path):
"""
Get processes which are running on given path or sub path of given path.
"""
pinfos = []
for proc in psutil.process_iter():
pinfo = proc.as_dict(attrs=['pid', 'name', 'exe', 'cwd', 'open_files'])