[python-win32] Passing an object to a process
Randy Syring
rsyring at gmail.com
Wed Mar 14 21:07:26 CET 2012
I've used the multiprocessing module to send data between processes:
http://docs.python.org/library/multiprocessing.html
But, its only in 2.6 and newer. Since they are all separate processes,
you could spawn a logging process and your worker processes as processes
that use a newer python and then use multiprocessing.
Another option might be to send the log messages to a database and then
have some process be responsible for pulling those messages out and
writing to a file (if needed).
Just some thoughts.
---------------------------------------------
Randy Syring
Development& Executive Director
Level 12 Technologies <https://www.lev12.com/> (formerly Intelicom)
Direct: 502-276-0459
Office: 502-212-9913
Intelicom is now Level 12 Technologies,learn more about our name change <https://www.lev12.com/our-history>.
Please update your address book with my new email address.
Principled People, Technology that Works
On 03/14/2012 02:53 PM, Tony Cappellini wrote:
>
> On Windows XP - I've got a program running which has spawned a process
> using os.spawnv().
>
> My program has a logger object instantiated that I want to pass to the
> process that was spawned.
> I need to log errors seen by the process, to the same logfile that the
> program uses for logging.
>
> I have the handle, thread ID, and process id of the process, but I see
> no way to share the logger object using these values.
>
> How can I pass a logger instance to the process, from the program
> which spawned the process?
>
> For legacy compatibility reasons, I'm stuck with an older version of
> Python that doesn't have the subprocess module and other features that
> are available with more modern releases of Python.
>
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120314/93e81b5a/attachment-0001.html>
More information about the python-win32
mailing list