Für alle anderen mit dem gleichen Problem wäre die Verwendung von Python-Sockets wahrscheinlich viel besser .
Ein Beispielcode, der das Problem in dieser Frage lösen würde:
import socket #AF_INET for IPv4, SOCK_STREAM for TCP (as opposed to UDP). clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Tell the socket what IP and port number to connect to (must be in two brackets because it needs a tuple). clientsocket.connect(('example.com', 1234)) #Recieve 1024 bytes of data. data = clientsocket.recv(1024) #Split the recieved data by newlines (returns a list). data = data.split('\n') #The first and second elements in our list should be the two numbers we need to add together, so we do that. result = int(data[0]) + int(data[1]) #Send our result to the server. clientsocket.send(str(result)) #Recieve any response from the server and print it to the screen. data = clientsocket.recv(1024) print data