Guest User

Untitled

a guest
Jun 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/usr/bin/env python
  2. """
  3. You can use this tool to display all supported colors and their color number.
  4. It will exit after a keypress.
  5. """
  6.  
  7. import curses
  8. from curses import *
  9.  
  10. @wrapper
  11. def main(win):
  12. def print_all_colors(attr):
  13. for c in range(0, curses.COLORS):
  14. init_pair(c, c, -1)
  15. win.addstr(str(c) + ' ', color_pair(c) | attr)
  16. use_default_colors()
  17. win.addstr("available colors: %d\n\n" % curses.COLORS)
  18. print_all_colors(0)
  19. win.addstr("\n\n")
  20. print_all_colors(A_BOLD)
  21. win.refresh()
  22. win.getch()
Add Comment
Please, Sign In to add comment