import serial, math ser = serial.Serial(port='COM6', baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, timeout=1) while not ser.readable(): print(":", end="") #txt = ser.readline().decode() # txt = ser.read_until('\n') #.decode() print(txt) while True: txt = ser.readline().decode() print(txt)