<div dir="ltr">I can think of two possible options:<div><br></div><div>1. Keep using Multiprocessing, and in each subprocess, rewrite sys.stdout to write to two local log files, then open two consoles and monitor the log files (suppose Windows has tools similar to 'tail -f' in unix. I am not familiar with Windows so sorry if it's not available.)</div>

<div><br></div><div>2.  If you really want to use subprocess, then I guess the easiest (but not necessarily the lightest or best) way is to use some lightweight message queue tools like zeromq. I am not sure if a local database like sqlite will work as well but it may worth trying.</div>

<div><br></div><div>Regards,</div><div><br></div><div>Nanshu</div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 7:41 PM, Tony Cappellini <span dir="ltr"><<a href="mailto:cappy2112@gmail.com" target="_blank">cappy2112@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote">Updated- changed multiprocess to multiprocessing<br><div dir="ltr"><div><div><div>

<div><div><div><div><div><div><div><div><br></div>I'm running Python 2.7.6 on 32-Bit Windows7 Pro. (Python 3 isn't an option at the moment)<br>
<br></div>I have a parent python script which spawns two subprocesses- where each subprocess is running<br>
</div>in a new console window. I want to watch each process running. This is why I've explicitly used<br></div><div>creationflags=CREATE_NEW_CONSOLE in the subprocess.Popen() call.<br><br><br>The subprocesses are running a simple CLI program which are monitoring some embedded devices being tested.<br>



</div><div>I don't want to use a GUI for them.<br></div><div><br>Here is the code for the parent script<br><a href="http://pastebin.com/mNNCH1vY" target="_blank">http://pastebin.com/mNNCH1vY</a><br><br></div>Ideally, I'd like the parent script to pass some information via a queue, to each subprocess.<br>



</div>The queues have nice functionality which would allow the receiving process to work until the queue is empty,<br></div><div>and then wait until it is no longer empty.</div><br></div>I don't see a way to use pass a queue using the subprocess module,<br>


</div>nor do I see a way to create a new console using the multiprocessing module.<br>
</div>Multiprocessing makes it quite easy to pass a queue to subprocesses.<br><br></div><div><br></div><div>I've spent a lot of time with the documentation for both modules, but it can be confusing.</div><div><br></div>


Is there a happy medium between these two modules that will help me<br></div>get what I want?<br><br><br><br>Thanks<br><div><div><div>
<div><div><br><br><div><div><div><br></div></div></div></div></div></div></div></div></div>
</div><br></div>
<br>_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="https://mail.python.org/mailman/listinfo/baypiggies" target="_blank">https://mail.python.org/mailman/listinfo/baypiggies</a><br></blockquote></div><br></div></div></div>