def __init__(self, sock: socket.socket): self._sock = sock sock_file = sock.makefile('rw') Cmdr.__init__(self, stdin=sock_file, stdout=sock_file) sys.stdout = sock_file Thread.__init__(self, name='HabPrompt', daemon=True)