#!/usr/bin/env python3 import serial def main(): with serial.Serial('/dev/ttyACM0', 9600, timeout=10) as ser: while True: b = ser.readline() if b: #print(b) print(b.decode('ascii').strip()) if __name__ == '__main__': main()