import serial from time import sleep print "Starting!" sp = serial.Serial("/dev/ttyUSB0",9600, timeout=1) #Start of Diamond sp.write("@01 AMOV 9000\r\n") sp.write("@02 AMOV 18000\r\n") raw_input("hit enter to continue to next stage!") sp.write("@01 amov 0\r\n") sp.write("@02 amov 9000\r\n") raw_input("hit a key to continue to next stage!") sp.write("@01 amov 9000\r\n") sp.write("@02 amov 0\r\n") raw_input("hit enter to continue to next stage!") sp.write("@01 amov 18000\r\n") sp.write("@02 amov 9000\r\n") raw_input("hit enter to continue to next stage!") sp.write("@01 amov 9000\r\n") sp.write("@02 amov 18000\r\n") sleep(2) print "closing" sp.close()