I have an Arduino connected to my computer running a loop, sending a value over the serial port back to the computer every 100 ms.
I want to make a Python scr
You will need a loop to read everything sent, with the last call to readline() blocking until the timeout. So:
def readLastLine(ser): last_data='' while True: data=ser.readline() if data!='': last_data=data else: return last_data