Skip to content

Instantly share code, notes, and snippets.

@EnriqueSoria
Created April 6, 2018 07:02
Show Gist options
  • Save EnriqueSoria/c91472e18791d67cd998ffefd3b7e993 to your computer and use it in GitHub Desktop.
Save EnriqueSoria/c91472e18791d67cd998ffefd3b7e993 to your computer and use it in GitHub Desktop.
import psutil
def check_process_running(processname, ending='.exe'):
process_list = [psutil.Process(pid).name() for pid in psutil.pids()]
return '{name}.exe'.format(name=processname) in process_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment