I need to open and close a application on a Windows machine using Python. I tried (opening the calculator):
import subprocess, time
p = subprocess.Popen(["calc"])
time.sleep(2)
p.terminate()
also using
p.kill()
does not work.
However, it seems that while the (python internal) subprocess is terminated, the application still remains visible on the screen (the calculator window does not close).
How can I open and close some application (including the actual visible window)?