1 # this kills yocto when it is being launched by geany
2 from subprocess
import Popen
, PIPE
7 ret
= Popen(cmd
, stdout
=PIPE
, stderr
=PIPE
, shell
=True).communicate()
11 processes_str
= exec_cmd('ps aux | grep "python main.py"')
12 processes
= list(enumerate(processes_str
.split('\n')))
13 sh_cmd
= ' /bin/sh -c python main.py'
14 geany_row
= [proc
for proc
in processes
if proc
[1].endswith(sh_cmd
)][0][0]
15 geany_pid
= list(processes
)[geany_row
+ 1][1].split()[1]
16 system('kill -9 ' + geany_pid
)