Getting some response from a python socket server
<p>I have just started learning python and i was wondering how i would get the client to execute a function on the server and get some response</p>

<p>Here is my server code</p>

<pre><code>import socket

serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('localhost', 8089)) 
serversocket.listen(5)

while True:
    connection, address = serversocket.accept()
    buf = connection.recv(64)
    if len(buf)&gt; 0:
        print(buf)
        break

input('press enter')
</code></pre>

<p>This is the client code</p>

<pre><code>import socket

clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect(('localhost', 8089)) 
data = 'lorem ipsum'
clientsocket.send(data.encode())
input('press enter')
</code></pre>

<p>and this is the function </p>

<pre><code>def addme(x,y):
    return x + y

print (addme(6,4))
</code></pre>

<p>Supposing i have the function <code>addme()</code> on the server,would it be possible to call it from the client and the response displayed to the client?.</p>
