EVENT for polling a file/device?

I'm working an a wxPython program which needs to receive intermittent events
from a user-interface peripheral (a Griffin Powermate knob). The interface to
the device is the event interface in Linux, so I access it like a file. Every
now and then there is data to be read, so I use a select call. Is there a way
to make an event out of this? Or is there a way to add this checking to the
main event loop?

The way I've don it so far is to have a wxTimer which initiates a read to the
device, but this is kind of ugly. I also thought of making a separate thread
to do the same thing, but that seems even more ugly.

Anybody have suggestions of the best way to do this?

Thanks
Matt

Unless the device outputs a steady stream of data or at regular
intervals, a timer isn't the way to go.

What exactly is so ugly about threading? It seems a natural solution to
the problem. Have a thread that posts events when select() returns
data. See the throbber demo for an example of posting events to from a
thread.

Regards,
Cliff

ยทยทยท

On Tue, 2003-07-01 at 15:25, Matthew Ettus wrote:

The way I've don it so far is to have a wxTimer which initiates a read to the
device, but this is kind of ugly. I also thought of making a separate thread
to do the same thing, but that seems even more ugly.

--
And in her fear, she sought cracked pleasures
                                    -Bauhaus