import serial import time myPort = serial.Serial('com8',9600) data = b'0,'b'0,'b'73,'b'-86,'b'-62,'b'49,'b'50,'b'500,'b'500' # gripperValue --- Gripper max , gripperValue , 0,0,73,-86,-62,49,150,500,500 def move(): myPort.write(data) print(data) move()