def reset_input_buffer(self): """Clear input buffer, discarding all that is in the buffer.""" if not self.is_open: raise portNotOpenError termios.tcflush(self.fd, termios.TCIFLUSH)