I'm using psutil 2.1.2 on python 64 bit on windows 8.1. I'm using psutil.process_iter() to iterate over the running processes to get details on a specific process. for some reason I don't get the process even though it is displayed in the Task Manager and the Process Explorer
for proc in psutil.process_iter():
try:
if proc.name() == 'svchost.exe': # patch for debugging
pass #script never gets here
opened_files = proc.open_files()
opened_files = [opened_file[0] for opened_file in opened_files]
if file_path in opened_files:
processes.append(proc)
except (psutil.AccessDenied, psutil.NoSuchProcess):
pass
I checked the proc name and it is never the process I'm looking for. example of a process I don't see is svchost.exe
Thanks for the help!