python调用串口,写入数据 #!/usr/bin/python3 import serial def serialTest(): try: port = "COM3" bps = 115200 timeO = 5 ser = serial.Serial(port, bps, timeout = timeO) result = ser.write("python invoke serial".encode("gbk")) print("write data: ", result) ser.close() except Exce