alarm.py 文件源码

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

项目:Utils 作者: disconsis 项目源码 文件源码
def center(stdscr, string, font, color_pair, oldwin):
    out = toilet(string, font)
    out_cols = max([len(line) for line in out])
    out_lines = len(out)
    win = curses.newwin(out_lines, out_cols,
                        (curses.LINES - out_lines)//2,
                        (curses.COLS - out_cols)//2)
    if oldwin is not None:
        oldwin.clear()
        oldwin.refresh()
    for li, line in enumerate(out):
        win.addstr(li, 0, line, color_pair)
    win.refresh()
    return win
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号