Re: [Newbie] How to wait for asyncronous input

2012-08-11 Thread Steven D'Aprano
On Sat, 11 Aug 2012 11:24:48 +0200, Hans Mulder wrote: > On 11/08/12 09:07:51, pozz wrote: >> When the main thread wants to close the serial port, the receiving >> thread can be killed > > > How would you do that? > > IFAIK, there is no way in Python to kill a thread. Correct. > The usual wo

Re: [Newbie] How to wait for asyncronous input

2012-08-11 Thread Hans Mulder
On 11/08/12 09:07:51, pozz wrote: > Il 11/08/2012 01:12, Dennis Lee Bieber ha scritto: >> What you apparently missed is that serial.read() BLOCKs until data >> is available (unless the port was opened with a read timeout set). >> [...] >> >> serial.read() may, there for, be using select() b

Re: [Newbie] How to wait for asyncronous input

2012-08-11 Thread pozz
Il 11/08/2012 01:12, Dennis Lee Bieber ha scritto: What you apparently missed is that serial.read() BLOCKs until data is available (unless the port was opened with a read timeout set). [...] serial.read() may, there for, be using select() behind the scenes. Hmm..., so I could o

[Newbie] How to wait for asyncronous input

2012-08-10 Thread pozz
I'm new to Python and I'm trying to code something to learn the language details. I'm in trouble with asyncronous events, like asyncronous inputs (from serial port, from socket and so on). Let's consider a simple monitor of the traffic on a serial port. I'm using pyserial and I looked at the