cursebox.py 文件源码

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

项目:cursebox 作者: Tenchi2xh 项目源码 文件源码
def put(self, x, y, text, fg, bg):
        """
        Puts a string at the desired coordinates using the provided colors.

        :param x:    X position
        :param y:    Y position
        :param text: Text to write
        :param fg:   Foreground color number
        :param bg:   Background color number
        """
        self.mutex.acquire()
        if x < self.width and y < self.height:
            try:
                self.screen.addstr(int(y), int(x),
                                   symbols.encode(text),
                                   self.pairs[fg, bg])
            except curses.error:
                # Ignore out of bounds error
                pass
        self.mutex.release()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号