Vote count:
0
import socket
def functions():
print ("hello")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('192.168.137.1', 20000)
sock.bind(server_address)
sock.listen(1)
conn, addr = sock.accept()
print ('Connected by', addr)
sock.listen(1)
conn.sendall(b"Welcome to the server")
My question is how to send a function to the client, I know that conn.sendall(b"Welcome to the server") will data to the client. Which can be decoded.
I would like to know how to send a function to a client like conn.sendall(function()) - this does not work
Also I would like to know the function that would allow the client to receive the function I am sending
I have looked on the python website for a function that could do this but I have not found one.
asked 26 secs ago
Python 3.4 Sockets sendall function
Aucun commentaire:
Enregistrer un commentaire