I have problems with subprocesses. The following code fragment is used to create a subprocess -
while(not myQueue.empty()):
p=Popen(myQueue.get(),shell=True,stdin=PIPE,stderr=PIPE)
I create processes iterating until the queue (which has the commands in it) is empty. The variable p is global and is an object of type Popen. Despite the fact that the team did what it was supposed to do, I am having problems with the stop button, which does not stop the process, as I expected.
The stop button code is as follows:
stop=Button(textBoxFrame,text="Stop",width=5,command=stopAll)
stop.grid(row=1,column=4)
The stopAll method is called by the aforementioned stop button, which will kill the current subprocess p.
def stopAll():
p.kill()
NOTE. No errors, exceptions or compilation issues.
UPDATE:
, p.kill() , . unix, >> ps aux. PID, ps aux. , , , 6 PIDs p.pid, os.kill((p.pid)+6,signal.SIGKILL), . , , . .
, , , . :
echo "Hello"|festival --tts
- unix, festival --tts . "Hello" , . p, , echo, festival. , , () .