[Tutor] Serial Port

dman dsh8290@rit.edu
Thu, 14 Feb 2002 17:13:33 -0500

On Thu, Feb 14, 2002 at 10:25:14AM -0800, Jeff Shannon wrote:
| > "Ajaya Babu" <ajaya@ncoretech.com> wrote:

I seem to be missing message(s).  Anyways ...

| > I want to access my serail port using python.  I am using linux
| > machine.  please suggest some reading on it.

The first serial port will be /dev/ttyS0.  Call open with that path as
the first argument, then read/write as you wish.  I don't know how to
set the various properties (ie speed, etc) apart from running
'setserial' as root.  One of the beauties of unix systems is that
devices "are" files.  You interact with the device by opening a file
and reading from it and writing to it.  (the same goes for the
parallel port, the mouse, the sound card, etc)



A violent man entices his neighbor
and leads him down a path that is not good.
        Proverbs 16:29