# E-2 MCS 275 Fri 16 Apr 2010 : ex2q3_client.py # This is the corresponding code for the client to test ex2q3.py from socket import * hostname = 'localhost' # on same host number = 12091 # same port number buffer = 10 # size of the buffer server_address = (hostname, number) client = socket(AF_INET, SOCK_STREAM) client.connect(server_address) print 'client is connected' n = input('Give number : ') data = str(n) client.send(data + (buffer-len(data))*' ') for i in range(0,n): c = raw_input('give character : ') client.send(c) client.close()