#!/usr/bin/env python

# Displays curses keys' constants values

import curses
import curses.ascii

for f in dir(curses.ascii):
    try: 
        resul= hex(eval('curses.ascii.' + f))
        print 'curses.ascii.%s = %s' % (f, resul)
    except TypeError:
        pass


for f in dir(curses):
    if f[0:4] == 'KEY_':
        try: 
            resul= hex(eval('curses.' + f))
            print 'curses.%s = %s' % (f, resul)
        except TypeError:
            pass
