0

When using a windows machine, what would be the easiest way to check if a process in running, using python. (Using Python, what's the best way to get a True/False answer for whether a process like "Notepad.exe" is running.)

Assuming that I cannot use WMI for reasons unknown, I would guess that the best/most upvoted answer would be something with psutil.

Thanks!

CoilKid
  • 335
  • 2
  • 3
  • 12
  • Also, I have tried previous answers to similar questions when they are resolved with psutil, but I keep getting syntax errors. I guess I just don't know how to use psutil. – CoilKid Oct 13 '14 at 05:22
  • Post the code and the errors you are getting. Try examples from [psutil.Processes](http://pythonhosted.org/psutil/#processes) – sk11 Oct 13 '14 at 06:26
  • @sk11 Thank you for the link, solved myself. If will help people with a similar problem, I can post as edit. (or answer) – CoilKid Oct 13 '14 at 14:43
  • Does this answer your question? [Check if a process is running or not on Windows with Python](https://stackoverflow.com/questions/7787120/check-if-a-process-is-running-or-not-on-windows-with-python) – alex Jan 27 '21 at 17:43

0 Answers0