Python操作串口:pyserial

jopen 10年前

pyserial:用Python操作串口,是python进行硬件进行操作不可或缺的一个库。

Features

  • Same class based interface on all supported platforms.
  • Access to the port settings through Python properties.
  • Support for different byte sizes, stop bits, parity and flow control with RTS/CTS and/or Xon/Xoff.
  • Working with or without receive timeout.
  • File like API with “read” and “write” (“readline” etc. also supported).
  • The files in this package are 100% pure Python.
  • The port is set up for binary transmission. No NULL byte stripping, CR-LF translation etc. (which are many times enabled for POSIX.) This makes this module universally useful.
  • Compatible with io library (Python 2.6+)
  • RFC 2217 client (experimental), server provided in the examples.

Requirements

  • Python 2.3 or newer, including Python 3.x
  • ctypes extension on Windows (is in standard library since Python 2.5+)
  • “Java Communications” (JavaComm) or compatible extension for Java/Jython

项目主页:http://www.open-open.com/lib/view/home/1421652678187