Oct-07-2018, 01:29 PM
(Oct-07-2018, 09:58 AM)evilcode1 Wrote: great its working but now how i cant now which of pro_find = ["opera.exe" , "chrome.exe" , "iexplore.exe" , "firefox.exe" , "microsoftedgecp.exe"]Can compare lists,
exist
set()
is best as there can be several process with same name.>>> process_list[:6] ['Registry', 'smss.exe', 'csrss.exe', 'wininit.exe', 'csrss.exe', 'winlogon.exe'] >>> pro_find = ['csrss.exe', 'smss.exe', "firefox.exe"] >>> p = set(pro_find) & set(process_list) >>> p {'csrss.exe', 'smss.exe'}So firefox.exe is not running.
Quote:exist and pass it name toI don't understand what you try to do here,it just process names a
dir
will not work without a absolute path.Should you be using
os.popen()