1

I will use gedit just as an example. I wanted it to open gedit via another terminal and then close it by killing the terminal:

import subprocess
import time

process = subprocess.Popen(['gnome-terminal', '-e', "gedit"])
time.sleep(3)
process.terminate()

The problem is that the terminal won't be killed. Any ideas?

João Cartucho
  • 3,688
  • 32
  • 39

1 Answers1

0

Have you tried using killing by the process ID rather than the generic process name?

Example: kill process with python

dreadera
  • 19
  • 5