import socket rc_socket = socket.socket() rc_socket.connect(('192.168.4.1', 1234)) # connect to robot rc_socket.send('l\n') # left rc_socket.send('r\n') # right rc_socket.send('f\n') # forward rc_socket.send('b\n') # backward rc_socket.send('q\n') # quit