From 837c7ed9d88f8578bb70e16e58be786165701312 Mon Sep 17 00:00:00 2001 From: John Ladan Date: Fri, 9 Mar 2012 16:28:38 -0500 Subject: [PATCH] Initial tests with curses --- cursestest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 cursestest.py diff --git a/cursestest.py b/cursestest.py new file mode 100755 index 0000000..6ba6eb2 --- /dev/null +++ b/cursestest.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import curses + + +def showBold(stdscr): + stdscr.addstr("Type any character to see it in bold\n") + ch = stdscr.getch() + + if (ch==curses.KEY_F1): + stdscr.addstr("F1 Key pressed") + + else: + stdscr.addstr("The key pressed is ") + stdscr.addch(ch, curses.A_BOLD) + + stdscr.refresh() + stdscr.getch() + +curses.wrapper(showBold)