OpenCV 2.1: Integration video capture into wxPython

So does the code:

import wxgui

if name == ‘main’:
gui = Process(target=wxgui.app.MainLoop(), …)
gui.start()
gui.join()

Needs to be adapted to:

import pregui

if name == ‘main’:
gui = Process(target=pregui.run(), …)
gui.start()
gui.join()

pregui.py

···

On Mon, Dec 6, 2010 at 4:16 PM, Robin Dunn robin@alldunn.com wrote:

… Whichever thread creates the wx.App object will be the one that wx treats as the main thread.


import wxgui

def run():

app = wx.App()

mygui = wxgui.MainFrame()

app.MainLoop()

So that the wx.App instance is created in the same Python module and OS process as the where the MainLoop() is called at? ??

Theoretically it should be possible to have more than one process in a process group

Didn’t know there were such things as process groups. Will have to learn about them some other time.

…to have a wx UI, but each of them would have to create a wx.App and run MainLoop(),

Makes good sense.

…and I suppose that it’s possible that that may interfere with the IPC that the subprocess module is using for the processes to communicate with each other.

Something to learn and understand another time for me.

It does not have to be the same Python module, but it does have to be the same OS process and the same thread in that process.

···

On 12/6/10 1:50 PM, Dev Player wrote:

On Mon, Dec 6, 2010 at 4:16 PM, Robin Dunn <robin@alldunn.com > <mailto:robin@alldunn.com>> wrote:

    ... Whichever thread creates the wx.App object will be the one that
    wx treats as the main thread.

So does the code:
import wxgui
if __name__ == '__main__':
     gui = Process(target=wxgui.app.MainLoop(), ...)
     gui.start()
     gui.join()

Needs to be adapted to:
import pregui
if __name__ == '__main__':
     gui = Process(target=pregui.run(), ...)
     gui.start()
     gui.join()
pregui.py
-------------
import wxgui
def run():
     app = wx.App()
     mygui = wxgui.MainFrame()
     app.MainLoop()
So that the wx.App instance is created in the same Python module and OS
process as the where the MainLoop() is called at? ??

--
Robin Dunn
Software Craftsman
http://wxPython.org

hey - seems really cool…

I’m still researching all the hardware and o/s aspects of my particular
project. I’m so impressed by everybody’s postings…

I’ve been looking at different linux distros to run in the car on the
mini-itx board. Choices seem to be : puppy-linux, damn-small-linux,
Fluxbuntu, and TinyMe. Also Windows works on a lot of car pc’s.

Anyway… how does this affect video capture in wx?

Well combined we seem to know quite a lot about this field. In
the car pc space, there isn’t actually a lot out there. Not past
install the Operating system.

If we know wx, then it means we in theory might know about
user interfaces.

So I am putting out the idea of a wx based car pc system,
based on some usb bootable linux distro, that could control
camera’s, stereo (a video player), navigation and maybe even
the disco lights in back… lol… (joking).

wx and python are an ideal combination for such a device
after all who could be bothered doing such a thing in C.

So far, I haven’t found anything active in this space… and I
don’t think it would be so hard to start up and run…

···

On Tue, Dec 7, 2010 at 8:50 AM, Dev Player devplayer@gmail.com wrote:

On Mon, Dec 6, 2010 at 4:16 PM, Robin Dunn robin@alldunn.com wrote:

… Whichever thread creates the wx.App object will be the one that wx treats as the main thread.

So does the code:

import wxgui

if name == ‘main’:
gui = Process(target=wxgui.app.MainLoop(), …)
gui.start()
gui.join()

Needs to be adapted to:

import pregui

if name == ‘main’:
gui = Process(target=pregui.run(), …)
gui.start()
gui.join()

pregui.py


import wxgui

def run():

app = wx.App()

mygui = wxgui.MainFrame()

app.MainLoop()

So that the wx.App instance is created in the same Python module and OS process as the where the MainLoop() is called at? ??

Theoretically it should be possible to have more than one process in a process group

Didn’t know there were such things as process groups. Will have to learn about them some other time.

…to have a wx UI, but each of them would have to create a wx.App and run MainLoop(),

Makes good sense.

…and I suppose that it’s possible that that may interfere with the IPC that the subprocess module is using for the processes to communicate with each other.

Something to learn and understand another time for me.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en