python类tcflush()的实例源码

a_sync.py 文件源码 项目:a_sync 作者: notion 项目源码 文件源码 阅读 36 收藏 0 点赞 0 评论 0
def a_input(prompt: str) -> str:
    """Async input prompt."""
    readable = []  # type: List[int]
    print(prompt, end='')
    sys.stdout.flush()
    while not readable:
        readable, _, _ = select.select([sys.stdin], [], [], 0)
        try:
            await asyncio.sleep(0.1)
        except futures.CancelledError:
            print("input cancelled...")
            termios.tcflush(sys.stdin, termios.TCIFLUSH)
            raise
    return sys.stdin.readline().rstrip()


# [ Classes ]
serialposix.py 文件源码 项目:android3dblendermouse 作者: sketchpunk 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
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)
serialposix.py 文件源码 项目:android3dblendermouse 作者: sketchpunk 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def reset_output_buffer(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self.is_open:
            raise portNotOpenError
        termios.tcflush(self.fd, termios.TCOFLUSH)
unix_console.py 文件源码 项目:pyrepl 作者: dajose 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def forgetinput(self):
        termios.tcflush(self.input_fd, termios.TCIFLUSH)
serialposix.py 文件源码 项目:microperi 作者: c0d3st0rm 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
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)
serialposix.py 文件源码 项目:microperi 作者: c0d3st0rm 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def reset_output_buffer(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self.is_open:
            raise portNotOpenError
        termios.tcflush(self.fd, termios.TCOFLUSH)
serialposix.py 文件源码 项目:microbit-gateway 作者: whaleygeek 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
serialposix.py 文件源码 项目:microbit-gateway 作者: whaleygeek 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """Clear output buffer, aborting the current output and
        discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCOFLUSH)
serialposix.py 文件源码 项目:mb_remote 作者: whaleygeek 项目源码 文件源码 阅读 36 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
serialposix.py 文件源码 项目:mb_remote 作者: whaleygeek 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """Clear output buffer, aborting the current output and
        discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCOFLUSH)
serialposix.py 文件源码 项目:gcodeplot 作者: arpruss 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
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)
serialposix.py 文件源码 项目:gcodeplot 作者: arpruss 项目源码 文件源码 阅读 47 收藏 0 点赞 0 评论 0
def reset_output_buffer(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self.is_open:
            raise portNotOpenError
        termios.tcflush(self.fd, termios.TCOFLUSH)
serialposix.py 文件源码 项目:gcodeplot 作者: arpruss 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
serialposix.py 文件源码 项目:gcodeplot 作者: arpruss 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """Clear output buffer, aborting the current output and
        discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCOFLUSH)
serialposix.py 文件源码 项目:bitio 作者: whaleygeek 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
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)
serialposix.py 文件源码 项目:bitio 作者: whaleygeek 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def reset_output_buffer(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self.is_open:
            raise portNotOpenError
        termios.tcflush(self.fd, termios.TCOFLUSH)
serialposix.py 文件源码 项目:microbit-serial 作者: martinohanlon 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
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)
serialposix.py 文件源码 项目:microbit-serial 作者: martinohanlon 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def reset_output_buffer(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self.is_open:
            raise portNotOpenError
        termios.tcflush(self.fd, termios.TCOFLUSH)
serialposix.py 文件源码 项目:CANbit 作者: whaleygeek 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
serialposix.py 文件源码 项目:CANbit 作者: whaleygeek 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """Clear output buffer, aborting the current output and
        discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCOFLUSH)
serialposix.py 文件源码 项目:driveboardapp 作者: nortd 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
serialposix.py 文件源码 项目:driveboardapp 作者: nortd 项目源码 文件源码 阅读 39 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCOFLUSH)
serial_adapter.py 文件源码 项目:Parlay 作者: PromenadeSoftware 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        termios.tcflush(self._f.fileno(), termios.TCIFLUSH)
serial_adapter.py 文件源码 项目:Parlay 作者: PromenadeSoftware 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """Clear output buffer, aborting the current output and
        discarding all that is in the buffer."""
        termios.tcflush(self._f.fileno(), termios.TCOFLUSH)
kbhit.py 文件源码 项目:overhead_mobile_tracker 作者: NU-MSR 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def flush(self):
        """
        flush stdin... untested on Windows"
        """
        if os.name == 'nt':
            while self.kbhit():
                self.getch()
        else:
            termios.tcflush(sys.stdin, termios.TCIOFLUSH)
        return


# Test
serialposix.py 文件源码 项目:mb_sdcard 作者: whaleygeek 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def flushInput(self):
        """Clear input buffer, discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
serialposix.py 文件源码 项目:mb_sdcard 作者: whaleygeek 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def flushOutput(self):
        """Clear output buffer, aborting the current output and
        discarding all that is in the buffer."""
        if not self._isOpen: raise portNotOpenError
        termios.tcflush(self.fd, TERMIOS.TCOFLUSH)
serialposix.py 文件源码 项目:ddt4all 作者: cedricp 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
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)
serialposix.py 文件源码 项目:ddt4all 作者: cedricp 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def reset_output_buffer(self):
        """\
        Clear output buffer, aborting the current output and discarding all
        that is in the buffer.
        """
        if not self.is_open:
            raise portNotOpenError
        termios.tcflush(self.fd, termios.TCOFLUSH)
serialposix.py 文件源码 项目:mt7687-serial-uploader 作者: will127534 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
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)


问题


面经


文章

微信
公众号

扫码关注公众号