Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- #Con il costrutto with il socket si chiude automaticamente.
- with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
- s.connect(('locahlhost', 6666))
- messaggio=input('-> ')
- s.sendall(messaggio.encode())
- data = s.recv(len(messaggio))
- print(f"Ricevuto {data.decode()}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement