pyserial模块封装了对串口的访问,兼容各种平台。
安装
pip insatll pyserial
初始化
简单初始化示例
import serial
ser = serial.Serial('com1', 9600, timeout=1)
所有参数
ser = serial.Serial(
port=None, # number of device, numbering starts at
# zero. if everything fails, the user
# can specify a device string, note
# that this isn
1