Here is a pretty simple socket program. This is about as simple as sockets get.
for the client program(CPU 1)
import socket
s = socket.socket()
host = '111.111.0.11' # needs to be in quote
port = 1247
s.connect((host, port))
print s.recv(1024)
inpt = raw_input('type anything and click enter... ')
s.send(inpt)
print "the message has been sent"
You have to replace the 111.111.0.11 in line 4 with the IP number found in the second computers network settings.
For the server program(CPU 2)
import socket
s = socket.socket()
host = socket.gethostname()
port = 1247
s.bind((host,port))
s.listen(5)
while True:
c, addr = s.accept()
print("Connection accepted from " + repr(addr[1]))
c.send("Server approved connection\n")
print repr(addr[1]) + ": " + c.recv(1026)
c.close()
Run the server program and then the client one.