Описание тега pyserial
NonePySerial is a Python module that encapsulates the access for the serial port. It provides backends for different platforms and Python implementations.
pySerial encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named serial
automatically selects the appropriate backend.
This is an example extracted from the introduction of the documentation:
>>> import serial
>>> ser = serial.Serial(0) # open first serial port
>>> print(ser.portstr) # check which port was really used
>>> ser.write("hello") # write a string
>>> ser.close() # close port
References: