fork download
  1. import socket
  2.  
  3. def main():
  4. with socket.socket() as s:
  5. s.connect(('128.0.0.1',12345))
  6. while (msg := input("Enter the message: ")) != 'exit' :
  7. s.sendall(msg.encode)
  8. print(s.recv(1024).decode())
Success #stdin #stdout 0.13s 16004KB
stdin
Standard input is empty
stdout
Standard output is empty