Samps — современная, безопасная и лёгкая Python-библиотека для работы с последовательным портом (serial port) без внешних зависимостей!
from samps import SerialCommonInterface as Serial
with Serial(port="/dev/tty.usbserial-0001", baudrate=9600) as serial:
print("Порт открыт?", "Да" if serial.is_open() else "Нет")
line = serial.readline()
print(line.decode("utf-8").strip())
print("Порт закрыт")
#Python #SerialPort #samps #AsyncIO #DevTools #PythonLibrary #SerialCommunication #Программирование #PythonDev #OpenSource #TechTools
https://github.com/michealroberts/samps
Please open Telegram to view this post
VIEW IN TELEGRAM
GitHub
GitHub - michealroberts/samps: Modern, type-safe, zero-dependency Python library for serial port I/O access
Modern, type-safe, zero-dependency Python library for serial port I/O access - michealroberts/samps
2🔥4 3