pySerial is a python library that encapsulates access to the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compilant system) and Jython. The module named “serial” automatically selects the appropriate backend.