import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(("127.0.0.1", 64999)) recv_limit = 1024 received = sock.recv(recv_limit) print(received)