0

I want a python script that terminate an aplications when I RUN another program. Example: if I run vlc media player that will close kodi.exe Or any other options to do this ?

sophros
  • 14,672
  • 11
  • 46
  • 75
fun_dogg
  • 9
  • 1

1 Answers1

0

It seems to me that what you have to do is enumerate processes by name, determine which to kill, and then kill it (the last part may be cumbersome a bit).

Did you have a chance to look at the following questions and their answers (they illustrate how to handle all of the steps above)?

  1. Determining running programs in Python
  2. List running processes on 64-bit Windows
  3. Is it possible to kill a process on Windows from within Python?
sophros
  • 14,672
  • 11
  • 46
  • 75
  • thank you ! I've used taskkill command and the subprocess.Popen command to open program it did work though but did try another program to taskkill but it doesn't kill the program.. – fun_dogg Oct 09 '17 at 17:47
  • Good to know it worked for you. Could you please indicate this marking the reply? Thank you. – sophros Oct 11 '17 at 11:01