Maybe if you show us your code we can better assist you.  <br><br>But maybe you can use a global variable or a try-catch method to keep threads from staying alive and help better control your code.  <br><br><div><span class="gmail_quote">
On 3/12/07, <b class="gmail_sendername">Taylor, Stuart</b> <<a href="mailto:Stuart.Taylor@disney.com">Stuart.Taylor@disney.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">







<div>


<p><font face="Arial" size="2">I have been working on running an external process using subprocess.popen for a few days.</font>

<br><font face="Arial" size="2">The process is ran over the network to another machine.</font>

<br><font face="Arial" size="2">One thing I have found is that if I perform readline() on the stdout it will hang if the process loses connection.</font>
</p>

<p><font face="Arial" size="2">I have tried a few things in a test example: one is to use stdin.write then stdin.flush() which send a string that readline() will read and it ends correctly but doesn't work on the project I need it to work on. Another is to try using threads and ignoar the thread when  the process has lost connection but this still leaves the open thread alive even when the main app has finished.
</font></p>

<p><font face="Arial" size="2">I am relatively new to python and I may be making a fundemantal mistake in my implementation, can anyone please inform me of whether sticking with subprocess.popen and readline() is the correct procedure for this sort of task?
</font></p>

<p><font face="Arial" size="2">And if anyone can point me in the correct implementation of this problem I would be gratefull.</font>
</p>
<br>

<p><font face="Arial" size="2">Thank you</font>
</p>

<p><font face="Arial" size="2">Stuart</font>
</p>

</div>
<br>--<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div>
<br>