Can wxPython subprocess display its data in the parent process ? [Revision 1]

Hi wxPython Gurus,

Could you tell me if the following is possible with wxPython ?

I have a wxPython application (call it A) that displays it’s data in two Frames.

This application starts another wxPython application (call it B) using subprocess.Popen.

B also displays its data in Frames.

My question is, could B display it’s data in A’s Frames ?

(How would one go about redirecting app.MainLoop() to another process ?)

After more thought, I think that I may not tackling the problem correctly: instead of trying to communicate wxPython objects/data between B and A, I figure I can send the data needed to create the wxPython object from B to A, either as direct inter-process-communication of the data, or using pickle files.

May I have your constructive criticism ?

Thanks,

Ron.

Barak, Ron wrote:

Hi wxPython Gurus,
Could you tell me if the following is possible with wxPython ?
I have a wxPython application (call it A) that displays it's data in two Frames.
This application starts another wxPython application (call it B) using subprocess.Popen.
B also displays its data in Frames.
My question is, could B display it's data in A's Frames ?
(How would one go about redirecting app.MainLoop() to another process ?)
After more thought, I think that I may not tackling the problem correctly: instead of trying to communicate wxPython objects/data between B and A, I figure I can send the data needed to create the wxPython object from B to A, either as direct inter-process-communication of the data, or using pickle files.
May I have your constructive criticism ?
Thanks,
Ron.

Well, there are some methods in subprocess that are specifically designed for getting and sending messages, but you can probably use pubsub just as easily and it would probably be "cleaner" to boot.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4101 (20090525) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Barak, Ron wrote:

Hi wxPython Gurus,
Could you tell me if the following is possible with wxPython ?
I have a wxPython application (call it A) that displays it's data in two Frames.
This application starts another wxPython application (call it B) using subprocess.Popen.
B also displays its data in Frames.
My question is, could B display it's data in A's Frames ?
(How would one go about redirecting app.MainLoop() to another process ?)
After more thought, I think that I may not tackling the problem correctly: instead of trying to communicate wxPython objects/data between B and A, I figure I can send the data needed to create the wxPython object from B to A, either as direct inter-process-communication of the data, or using pickle files.
May I have your constructive criticism ?

You'll be much better off if you conceptually separate the data from the presentation of the data. The data is what you want to be passing back and forth and the view or presentation of that data is the UI and belongs entirely to each application. In other words, you can't pass GUI objects back and forth between processes, but you can pass the data that those GUI objects will display.

···

--
Robin Dunn
Software Craftsman