Here is one way to do this using AppleScript:
import subprocess def is_runnning(app): count = int(subprocess.check_output(["osascript", "-e", "tell application \"System Events\"", "-e", "count (every process whose name is \"" + app + "\")", "-e", "end tell"]).strip()) return count > 0 print is_runnning("iTunes")
See also this one for some options.
source share