import socket s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) s.connect (('localhost', 9999)) s.send (b'1') s.close