Skip to content

Commit 44a7cb8

Browse files
committed
Curses
1 parent c959a26 commit 44a7cb8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,22 +1668,25 @@ with open(<filename>, encoding='utf-8') as file:
16681668
Curses
16691669
------
16701670
```python
1671-
from curses import wrapper
1671+
from curses import wrapper, ascii
16721672

16731673
def main():
16741674
wrapper(draw)
16751675

16761676
def draw(screen):
16771677
screen.clear()
16781678
screen.addstr(0, 0, 'Press ESC to quit.')
1679-
while screen.getch() != 27:
1679+
while screen.getch() != ascii.ESC:
16801680
pass
16811681

16821682
def get_border(screen):
16831683
from collections import namedtuple
16841684
P = namedtuple('P', 'x y')
16851685
height, width = screen.getmaxyx()
16861686
return P(width-1, height-1)
1687+
1688+
if __name__ == '__main__':
1689+
main()
16871690
```
16881691

16891692

0 commit comments

Comments
 (0)