# coding=utf-8import serial
ser=serial.Serial('com1',9600)ser.write(b"hello")while 1: ser.write(ser.read(3))ser.close()