__main__.py 文件源码

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

项目:asciidots 作者: aaronduino 项目源码 文件源码
def print_char(self, char, color_code, row=None, col=None):
        """
        Print one char to the screen with coloration.

        In compat_debug this will just append the char to stdout. This checks for silent mode
        :param char: The character to print
        :param color_code: The colorcode 1234 = RGYB
        :param row: The y pos used with curses
        :param col: The x pos used with curses
        """

        if self.silent:
            return 42

        if self.compat_debug:
            if not color_code:
                # Zero is the regular print, but the code 33 will draw black over black and we dont want that
                print(char, end='')
            else:
                print('\033[0;3', color_code, 'm', char, '\033[0m', sep='', end='')
        else:
            self.win_program.addstr(row, col, char, curses.color_pair(color_code))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号