Python multiprocessor with 2 gtk windows

I am trying to create a python script that uses a multiprocessing module to create 2 (or more) GTK windows. I seem to hit the wall. Here is the code and the errors I get:

p1 = Process(target=tiny_gtk_process, name="process 1")
p1.start()
p2 = Process(target=tiny_gtk_process, name="process 2")
p2.start()

and

def tiny_gtk_process():

    import gtk

    window = gtk.Window()
    window.set_size_request(800,600)

    window.show_all()

    gtk.main()

In most cases, I get:

multiwin.py: Fatal IO error 0 (Success) on server X: 0.0. python: ../../ src / xcb_io.c: 249: process_responses: The statement `(((long) (dpy-> last_request_read) - (long) (dpy-> request)) <= 0) 'failed.

Sometimes I get:

multiwin.py: Fatal IO error 11 (resource temporarily unavailable) on server X: 0.0.

Is the problem a gtk loop? Does their multiprocessing isolate?

Any ideas would be very helpful.

+5
source share
1 answer

, , , multiprocessing.Process, , fork() exec(). , , , , X-. , .

subprocess.Popen . , . .

0

All Articles