Hi, I am using netcat to listen to a port and python to read stdin and print to the console.
nc -l 2003 | python print_metrics.py sys.stdin.flush() doesn’t seem to flush stdin, so I am using the termios module. while True: input = sys.stdin.readline() # do some parsing … sys.stdout.write(parsed_data) time.sleep(3) termios.tcflush(sys.stdin, termios.TCIOFLUSH) I am receiving this exception termios.error: (25, 'Inappropriate ioctl for device') I will be using this script on Unix based systems and I wondered what approach I could use to flush stdin? Many Thanks Aidy
-- https://mail.python.org/mailman/listinfo/python-list