host = socket.gethostbyname_ex(socket.gethostname())[-1][-1]
port = 6677
print(socket.gethostbyname_ex(socket.gethostname()))
print(host)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((host, port))
s.listen()
while True:
conn, addr = s.accept()
while True:
data = conn.recv(1024).decode('utf-8').lower()
print(data)
import socket
HOST='192.168.0.13'
PORT= 6677
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
while True:
s.send(input().encode('utf-8')