Skip to content

Instantly share code, notes, and snippets.

@jeroendelfos
Created August 16, 2019 09:38
Show Gist options
  • Save jeroendelfos/0add1e54d882aff75acd99d2b604d2f4 to your computer and use it in GitHub Desktop.
Save jeroendelfos/0add1e54d882aff75acd99d2b604d2f4 to your computer and use it in GitHub Desktop.
Check if a program is running on your OS
def program_running(program_name):
prgrm = [p.name() for p in psutil.process_iter() if p.name() == program_name]
prgrm_is_running = len(r)>0
return prgrm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment