#!/usr/bin/python
import curses, sys

#c = curses.wrapper(s)
#w = curses.initscr()
#curses.start_color()
#print "TERM is", curses.termname()
#if curses.has_colors():
#   print "Has colors"#
#print curses.color_pair(curses.COLOR_RED), "Red"
#curses.endwin()

#curses.setupterm('xterm')
curses.setupterm()

if sys.stdout.isatty():
    print "Is a TTY"

print "Size is %sx%s" % (curses.tigetnum('lines'), curses.tigetnum('cols'))

if curses.tigetnum('colors') > 0:
    print "Has colors"
    print curses.tigetnum('colors')
