Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5380

Re: threads with gtk gui problem

Date 2011-05-14 19:51 +0100
From andy baxter <andy@earthsong.free-online.co.uk>
Subject Re: threads with gtk gui problem
References <4DCE7FCC.8020907@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1557.1305399104.9059.python-list@python.org> (permalink)

Show all headers | View raw


On 14/05/11 14:12, Andy Baxter wrote:
> Hi,
>
> I'm working on adding a Gtk GUI to a python program. Its main function 
> is to read raw data from an arduino board over USB, and convert it to 
> MIDI note/controller events to be sent to another program. I've had it 
> working fine with just a command line interface, but when I replaced 
> the command line with a Gtk interface, I started having problems 
> getting the thread that reads the USB port to run.

I've solved this by adding 'import gobject' and 'gobject.threads_init()' 
to the start of the program. Looks like if you don't do this then the 
gtk main loop never releases the python threading lock to other threads.

andy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: threads with gtk gui problem andy baxter <andy@earthsong.free-online.co.uk> - 2011-05-14 19:51 +0100

csiph-web