def _process_stdin(self): """ Received data on stdin. Read and send to server. """ with nonblocking(sys.stdin.fileno()): data = sys.stdin.read() self._send_packet({"cmd": "in", "data": data})
def _process_stdin(self): """ Received data on stdin. Read and send to server. """ with nonblocking(sys.stdin.fileno()): data = sys.stdin.read() self._send_packet({ 'cmd': 'in', 'data': data, })
def _process_stdin(self): """ Received data on stdin. Read and send to server. """ with nonblocking(sys.stdin.fileno()): data = self._stdin_reader.read() # Send input in chunks of 4k. step = 4056 for i in range(0, len(data), step): self._send_packet({ 'cmd': 'in', 'data': data[i:i + step], })