Re: [python-win32] Passing an object to a process

2012-03-14 Thread python
What about logging to a database? Malcolm ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Tony Cappellini
Thanks for all the advice. The solution is simple, but neither elegant nor Pythonic. It's a kludge, but will suffice. The process simply opens & writes a 1 line log file, then closes it. The process also increments a counter each time the log file is written, and writes the counter value to the p

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Max Slimmer
If you are really just logging, use separate loggers/files, sync the clocks, and timestamp records, then merge when you are ready to process if you need timeline related results. On Wed, Mar 14, 2012 at 1:29 PM, Preston Landers wrote: > On Wed, Mar 14, 2012 at 2:55 PM, Tony Cappellini wrote: >>

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Preston Landers
On Wed, Mar 14, 2012 at 2:55 PM, Tony Cappellini wrote: > >> >>in which objects can truly move from one process to another is >> >>recreating them in the other process.  Even fork() makes copies of >> >> everything. > > Recreating an object in another process means it's a different object, not a >

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Randy Syring
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

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Tony Cappellini
> >>in which objects can truly move from one process to another is > >>recreating them in the other process. Even fork() makes copies of > everything. > Recreating an object in another process means it's a different object, not a shared one. > > >>Have you tried pickle or other techniques of ser

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Max Slimmer
depends what you mean by share logger object, you might be able to have logger on both apps share a common log file. OTH if you want realtime events, I pass a socket from one app to another and have implemented a proxy dialog so one app writes to the progress dialog proxy and it in turn sends data

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Tim Roberts
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 bet

Re: [python-win32] Passing an object to a process

2012-03-14 Thread Preston Landers
Without getting into too philosophical of a discussion, the only sense in which objects can truly move from one process to another is recreating them in the other process. Even fork() makes copies of everything. Have you tried pickle or other techniques of serialization? Not sure offhand if the l

[python-win32] Passing an object to a process

2012-03-14 Thread Tony Cappellini
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 ha