When closing my application, all threads, and Tkinter Threads close successfully but a subprocess that I have refuses to close on exit.
class ThreadedTask(Thread):
def __init__(self, queue):
Thread.__init__(self)
self.queue = queue
def run(self):
proc = Popen("receivetest -f=/dev/pcan33".split(), stdout = PIPE)
payload = iter(proc.stdout.readline, "")
for line in payload:
if line[0].isdigit():
splitline = line.split()
self.dictAdd(splitline)
This is the Class containing the subprocess.
And this is the call at the beginning:
if __name__ == "__main__":
root = tk.Tk()
Data = Queue.Queue()
DataThread = ThreadedTask(Data)
DataThread.daemon = True
DataThread.start()
myapp = BaudWindow(root)
root.mainloop()
As I say everything else closes correctly. Is this due to the fact I have nested a subprocess into a thread?