From 44a7cb858c55687b51c767740d4b544995ae25b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 24 Mar 2019 13:20:17 +0100 Subject: [PATCH] Curses --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c5f58b..2d04564 100644 --- a/README.md +++ b/README.md @@ -1668,7 +1668,7 @@ with open(, encoding='utf-8') as file: Curses ------ ```python -from curses import wrapper +from curses import wrapper, ascii def main(): wrapper(draw) @@ -1676,7 +1676,7 @@ def main(): def draw(screen): screen.clear() screen.addstr(0, 0, 'Press ESC to quit.') - while screen.getch() != 27: + while screen.getch() != ascii.ESC: pass def get_border(screen): @@ -1684,6 +1684,9 @@ def get_border(screen): P = namedtuple('P', 'x y') height, width = screen.getmaxyx() return P(width-1, height-1) + +if __name__ == '__main__': + main() ```