screen.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:python-sense-emu 作者: RPi-Distro 项目源码 文件源码
def _touch_run(self):
        while not self._touch_stop.wait(1):
            # "touch" the screen's frame-buffer once a second. This ensures
            # that the screen always updates at least once a second and works
            # around the issue that screen updates can be lost due to lack of
            # resolution of the file modification timestamps. Unfortunately,
            # futimes(3) is not universally supported, and only available in
            # Python 3.3+ so this gets a bit convoluted...
            try:
                if os.utime in os.supports_fd:
                    os.utime(self._fd.fileno())
                else:
                    raise NotImplementedError
            except (AttributeError, NotImplementedError) as e:
                os.utime(self._fd.name, None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号