I thought I'd contribute this to the community since it took me a little while to figure out how to get this right. It shows how to send a command to an iTach CC and how to handle the return values using sockets in python. It can get tighter/cleaner, but I left it very basic so it's easier for people to play with.
HOST2 = '192.168.1.201'
PORT2 = 4998
s = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
response = s.recv(24) #This is the echo back from iTach
print "Response from send():", response
state = s.recv(24)
if ( int(state[10:11]) == 1 ):
print "Current state is ON"
elif ( int(state[10:11]) == 0 ):
print "Current state is OFF"
print "Unknown. Got:", state