# Echo client program import socket HOST = '' # The remote host PORT = 50008 # The same port as used by the server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) # Change stuff starting here s.send('1 1 1 1') data = s.recv(1024) x = data.split(" ") print 'Exact position count: ', x[0] print ' Correct value wrong position count:', x[1] totsofar = 0 if 0 < int(x[0]): print "1 is present: ", x[0], " times." totsofar+= int(x[0]) s.send('2 2 2 2') data = s.recv(1024) x = data.split(" ") if 0 < int(x[0]): print "2 is present: ", x[0], " times." totsofar+= int(x[0]) print "Total numbers seen so far is: ", totsofar s.close() # print 'Received', repr(data)