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()
评论列表
文章目录