#!/usr/bin/python
# -*- coding:utf-8 -*-
import serial

ser = serial.Serial("/dev/ttyS0",115200)

print('serial test start ...')
ser.write("Hello Wrold !!!\n")
try:
        while True:
                    ser.write(ser.read())
except KeyboardInterrupt:
        if ser != None:
                    ser.close()

@@ -10,16 +10,17 @@
 n/python
+ 
 %0A# -*- c
@@ -29,16 +29,17 @@
 ing:
+ 
 utf-8 -*
 -%0Aim
@@ -34,17 +34,16 @@
 utf-8 -*
--
 %0Aimport 
@@ -48,16 +48,28 @@
 t serial
+%0Aimport time
 %0A%0Aser = 
@@ -99,16 +99,17 @@
 S0%22,
+ 
 115200)%0A
 %0Apri
@@ -108,138 +108,262 @@
 00)%0A
-%0Aprint('serial test start ...')%0Aser.write(%22Hello Wrold !!!%5Cn%22)%0Atry:%0A        while True:%0A                    ser.write(ser.read())%0A
+def main():%0A    while True:%0A        count = ser.inWaiting()%0A        if count != 0:%0A            recv = ser.read(count)%0A            ser.write(recv)%0A        ser.flushInput()%0A        time.sleep(0.1)%0A   %0Aif __name__ == '__main__':%0A    try:%0A        main()%0A    
 exce
@@ -416,32 +416,24 @@
             
-        
 ser.close()%0A
@@ -431,9 +431,8 @@
 .close()
-%0A

check python serial module