# python client

import sys 
from socket import * 

serverHost = 'localhost'
serverPort = 2000

s = socket(AF_INET, SOCK_STREAM) #create a TCP socket 
s.connect((serverHost, serverPort)) # connect to server on the port 

message = 'Hello world';

while True:

    # read robot sensors

    # read vision sensors
    # message = "blobs"
    s.send(message) #send the data 
    data = s.recv(1024) #receive up to 1K bytes 
    print "I received the data:", data 

    if message == 'quit': # to quit the server, too
        break

    if message == 'q': # just quits the client
        break

    message = raw_input("Type a string to send: ")


    # decide what to do

    # send to motors...


print 'Good bye!'

