[Baypiggies] Help with starting new processes- updated
cappy2112 at gmail.com
Sat Aug 23 04:41:07 CEST 2014
Updated- changed multiprocess to multiprocessing
I'm running Python 2.7.6 on 32-Bit Windows7 Pro. (Python 3 isn't an option
at the moment)
I have a parent python script which spawns two subprocesses- where each
subprocess is running
in a new console window. I want to watch each process running. This is why
I've explicitly used
creationflags=CREATE_NEW_CONSOLE in the subprocess.Popen() call.
The subprocesses are running a simple CLI program which are monitoring some
embedded devices being tested.
I don't want to use a GUI for them.
Here is the code for the parent script
Ideally, I'd like the parent script to pass some information via a queue,
to each subprocess.
The queues have nice functionality which would allow the receiving process
to work until the queue is empty,
and then wait until it is no longer empty.
I don't see a way to use pass a queue using the subprocess module,
nor do I see a way to create a new console using the multiprocessing module.
Multiprocessing makes it quite easy to pass a queue to subprocesses.
I've spent a lot of time with the documentation for both modules, but it
can be confusing.
Is there a happy medium between these two modules that will help me
get what I want?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Baypiggies