python check if exe is running

#Iterates through all the programs running in your system and checks for the one in the string
import psutil    
"someProgram" in (p.name() for p in psutil.process_iter())

Here is what the above code is Doing:
1. psutil.process_iter() returns an iterator over all running processes.
2. The iterator is passed to a generator expression.
3. The generator expression yields the name() of each process.
4. “someProgram” is checked for membership in the generator expression.