Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- client_socket.connect(("127.0.0.1",8081))
- print("Connected")
- data=client_socket.recv(1024)
- message=data.decode()
- print(message)
- #Send a message back to the server
- message="Have a Great Day"
- data=message.encode()
- client_socket.send(data)
- #close socket
- client_socket.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement