I’m trying to determine in python if a certain application is already open so that I don’t open it twice. I’ve done a little research and have found that it is possible to pull the process name of a program, but the only issue I have with that is the program I am checking for itself has a pretty generic process name (in this case, “pythonw.exe” or “cmd.exe”).
It does however have differing names in the application list of Windows Task Manager, so my question is if there is any way to use that to detect if a program is open or not. My workplace will not allow me to download additional programs or modules to use for this script, so the answer needs to use the os module or something similar that is already included in the windows library.
I think the Python standard modules can’t finish your requirement. It need some 3rd party libs, like
win32api,win32pdhutil,win32con.Another approach is using windows command
tasklist. Use Python as the bat wrapper, and parse the output oftasklist.