listener = serial.Serial(com_port1, baudrate)
forwarder = serial.Serial(com_port2, baudrate)
while 1:
    serial_out = listener.read(size=1)
print(serial_out)
forwarder.write(serial_out)
How to make a serial port sniffer sniffing physical port using a python