10 lines
273 B
Python
10 lines
273 B
Python
import socket
|
|
with socket.create_connection(("127.0.0.1", 1234), timeout=1) as sock:
|
|
sock.sendall(b"help\r\nquit\r\n")
|
|
response = b""
|
|
while True:
|
|
chunk = sock.recv(4096)
|
|
if not chunk: break
|
|
response += chunk
|
|
print(response.decode())
|