<br>A select() loop should work.<br><br><div class="gmail_quote">On Fri, Aug 10, 2012 at 1:01 PM, loial <span dir="ltr"><<a href="mailto:jldunn2000@gmail.com" target="_blank">jldunn2000@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am writing an application to send data to a printer port(9100) and then recieve PJL responses back on that port. Because of the way PJL works I have to do both in the same process(script).<br>
<br>
At the moment I do not start to read responses until the data has been sent to the printer. However it seems I am missing some responses from the printer whilst sending the data, so I need to be able to do the 2 things at the same time.<br>
<br>
Can I open a port once and then use 2 different threads, one to write to the post and one to read the responses)?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br>