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.

That's impossible.  Objects are just memory, and memory cannot be shared
between processes.


> I need to log errors seen by the process, to the same logfile that the
> program uses for logging.

You can certainly create a new logger instance in your spawned process
and have it write to the same file.  As long as the logging module
flushes after each write, that should work.


> 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.

Another alternative is to use popen instead of spawn, and have your
spawned process write its messages to stdout.  You could then echo them
on to the logfile in your original process.  That has its own buffering
problems.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to