[Tutor] question about serial coms
nephish at xit.net
Mon Nov 14 19:51:05 CET 2005
Yeah, i am using pyserial, i think, in debian its called python serial
and i use import serial to get things going.
Really easy, just wanted to know about this stuff before i start
scrambling this like so many eggs.
i will not be using two different scripts, but likely two threads in the
same script. not sure i really get what select() is all about
great link by the way, thanks.
On Mon, 2005-11-14 at 12:35 -0600, Hugo González Monteverde wrote:
> Hi Nephish,
> Are you using pyserial or rolling your own? Normally you can write and
> read to the /dev/ttySXX file at the same time; since they're special
> files, not ordinary files, the driver handles that.
> Handling both writing and reading in your program's flow control is a
> wholly different matter, though. You might need to use select() to
> avoid blocking.
> Are you using two completely different scripts for reding and writing?
> There is some valuable info, if not about python, in the Serial
> Programming howto, at:
> nephish wrote:
> > Hey there,
> > i am developing on a linux computer with the serial module. Now, i
> > already am able to recieve info from a serial RS232 device and process
> > everything ok. What i need to do now is write to the serial device, but
> > i also need to be able to not interrupt the script that is reading from
> > it.
> > I guess my question is, do i have to interrupt the reading script to
> > write to the same RS232 device ?
> > and if so, how do i do that?
> > thanks,
> > shawn
> > _______________________________________________
> > Tutor maillist - Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor