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


Groups > comp.lang.python > #5380 > unrolled thread

Re: threads with gtk gui problem

Started byandy baxter <andy@earthsong.free-online.co.uk>
First post2011-05-14 19:51 +0100
Last post2011-05-14 19:51 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#5380 — Re: threads with gtk gui problem

Fromandy baxter <andy@earthsong.free-online.co.uk>
Date2011-05-14 19:51 +0100
SubjectRe: threads with gtk gui problem
Message-ID<mailman.1557.1305399104.9059.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web