Saturday, 31 August 2013

How to use terminal color palette with curses

How to use terminal color palette with curses

I can't get the terminal color palette to work with curses.
import curses
def main(stdscr):
curses.use_default_colors()
for i in range(0,7):
stdscr.addstr("Hello", curses.color_pair(i))
stdscr.getch()
curses.wrapper(main)
This python script yields the following screen:

However, I do have more colors in my gnome-terminal palette. How can I
access them within curses?

No comments:

Post a Comment