I'm running calc.exe (windows 10, python 3.6) using proc = subprocess.Popen("calc.exe")
, then time.sleep(time)
and then want to kill process: os.kill(proc.pid, -9)
or os.kill(proc.pid, signal.SIGTERM)
gives me error
"Access Denied".
I also tried proc.terminate - it didn't help.
And I also noticed that proc.pid gives different PID from PID which is shown in task manager. Any ideas how to kill my process?
Thanks!