So I'm writing some python and I want to make an if statement that checks if a program is running I figured the simplest way would be to use subprocess and check with cmd if the program is running. Since the program needs to be running at all times, it would also be ideal to have it start the program if it is not running.
I was hoping for something such as:
IF [NOT] RUNNING foo.exe foo.exe
but as far as I have found, there isn't really anything like that. Sorry if this in almost unbearably easy, this is my first year really doing any programming, so I'm learning one step at a time haha.