init curses

This commit is contained in:
ProgramSnail 2021-04-12 21:17:06 +03:00
parent ca13938f54
commit 39eeef1dc8
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,32 @@
import curses
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
curses.curs_set(0)
stdscr.keypad(True)
curses.start_color()
SIMPLE = 1
ACTIVE = 2
curses.init_pair(SIMPLE, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(ACTIVE, curses.COLOR_BLACK, curses.COLOR_WHITE)
def draw():
stdscr.addstr(0, 0, "Hello World!", curses.color_pair(SIMPLE))
while(True):
stdscr.clear()
draw()
stdscr.refresh()
stdscr.getkey()
curses.nocbreak()
stdscr.keypad(False)
curses.echo()
curses.endwin()

View file

@ -0,0 +1 @@
curses