Created
March 27, 2021 12:56
-
-
Save aledruetta/0f56f5cbc654ada028a5a2bad5c9eccd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cliente.py | |
from socket import * | |
HOST = "192.168.1.2" | |
PORT = 5001 | |
def upper_rcp(msg): | |
s = socket(AF_INET, SOCK_STREAM) | |
s.connect((HOST, PORT)) | |
s.send(msg.encode()) | |
data = s.recv(1024) | |
s.close() | |
return data.decode() | |
if __name__ == "__main__": | |
msg = input("say> ") | |
resp = upper_rcp(msg) | |
print(f"echo> {resp}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment