Код: Выделить всё
>>> import subprocess
>>> proc=subprocess.Popen(["xfce4-terminal"])
>>> #you should see the terminal is started...
>>> proc.terminate()
>>> #it is still there, alive and kicking...
>>> import os
>>> os.kill(proc.pid, 9) #let's try something more radical (SIGKILL)
Traceback (most recent call last):
File "", line 1, in
ProcessLookupError: [Errno 3] No such process
>>> # WTF???
Код: Выделить всё
(base) [matias@kashyyyk bec]$ xfce4-terminal &
[1] 167148
(base) [matias@kashyyyk bec]$ kill 167148
bash: kill: (167148) - No such process
Я действительно озадачен. Что происходит?
Подробнее здесь: https://stackoverflow.com/questions/792 ... -be-killed
Мобильная версия