stm32-fmt-code/access_control_python/test2.py

13 lines
201 B
Python

import serial
ser = serial.Serial('COM13', 115200)
data = b''
while True:
byte = ser.read()
if byte == b'\x03':
break
data += byte
data_str = data.decode('utf-8')
print(data_str)