Doesn't may example not do what you explain?
Let take you list and run on my system now.
If i start FireFox.
Let take you list and run on my system now.
>>> pro_find = ["opera.exe" , "chrome.exe" , "iexplore.exe" , "firefox.exe" , "microsoftedgecp.exe"] >>> p = set(pro_find) & set(process_list) >>> p {'chrome.exe'}So it find that i have Chrome running,and none of the other is running.
If i start FireFox.
>>> p = set(pro_find) & set(process_list) >>> p {'firefox.exe', 'chrome.exe'}What's not running.
>>> p = set(pro_find) - set(process_list) >>> p {'opera.exe', 'microsoftedgecp.exe', 'iexplore.exe'}