00001 #!/usr/bin/env python 00002 00003 import serial, sys 00004 00005 if len(sys.argv) != 2: 00006 print "python: Usage_serial_test <port name like: /dev/ttyUSB0>" 00007 sys.exit(1) 00008 00009 sio = serial.Serial(sys.argv[1], 115200) 00010 sio.timeout = 250 00011 00012 while True: 00013 sio.write("Testing.") 00014 print sio.read(8) 00015