File: curstest

package info (click to toggle)
dstat 0.7.4-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,600 kB
  • sloc: python: 5,964; makefile: 70; sh: 3
file content (23 lines) | stat: -rwxr-xr-x 521 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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')