curses_colors.py 文件源码

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

项目:defuse_division 作者: lelandbatey 项目源码 文件源码
def _test(stdscr):
    import time

    colors_init()
    label_width = max([len(k) for k in CURSES_COLORPAIRS.keys()])
    cols = 4
    for idx, k in enumerate(CURSES_COLORPAIRS.keys()):
        label = "{{:<{}}}".format(label_width).format(k)
        x = (idx % cols) * (label_width + 1)
        y = idx // cols

        pair = curses.color_pair(CURSES_COLORPAIRS[k])
        stdscr.addstr(y, x, label, pair)
        time.sleep(0.1)
        stdscr.refresh()
    stdscr.getch()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号