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?