Serial IO

Mat Martineau mmartine at tc.fluke.com
Tue Jun 19 18:47:16 CEST 2001


As far as I've seen, there are two ways to do serial communication in
Python:

* On win32 systems, use win32file.  There's a demo of this (at least in
  the ActiveState distribution of Python 2.1) under
  Python21/win32/Demos/win32comport_demo.py

* On Unix systems, you need to use termios.  Fortunately, there's an
  example of how to do this, posted on this newsgroup last November:

http://groups.google.com/groups?safe=off&rnum=5&ic=1&selm=t0VQ5.8786%24FU3.2195648%40ptah.visi.com

  Unfortunately, the stock 2.1 distribution on Linux is pretty much broken
  for serial communication - an important #include was commented out,
  so some necessary constants are unavailable.  Both 2.0 and snapshots of
  2.2 seem to have the constants included correctly.  Hopefully, 2.1.1
  will fix this issue.

  Also, the TERMIOS module is deprecated in Python 2.1 (constants were
  moved to termios), so the code linked above will need to be modified
  accordingly.

Mat Martineau


On Tue, 19 Jun 2001, Andrew Todd wrote:

> Hey,
> I was looking through python.org and I noticed there was a
> serial io package for python, but it was for version 1.5.
> Is there going to be a release for python 2.1 or 2.2? or is
> the code compatible? Also, if anyone knows of any GPIB
> modules please let me know. Thanks.
>
> -Andrew
>
>




More information about the Python-list mailing list