We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c959a26 commit 44a7cb8Copy full SHA for 44a7cb8
README.md
@@ -1668,22 +1668,25 @@ with open(<filename>, encoding='utf-8') as file:
1668
Curses
1669
------
1670
```python
1671
-from curses import wrapper
+from curses import wrapper, ascii
1672
1673
def main():
1674
wrapper(draw)
1675
1676
def draw(screen):
1677
screen.clear()
1678
screen.addstr(0, 0, 'Press ESC to quit.')
1679
- while screen.getch() != 27:
+ while screen.getch() != ascii.ESC:
1680
pass
1681
1682
def get_border(screen):
1683
from collections import namedtuple
1684
P = namedtuple('P', 'x y')
1685
height, width = screen.getmaxyx()
1686
return P(width-1, height-1)
1687
+
1688
+if __name__ == '__main__':
1689
+ main()
1690
```
1691
1692
0 commit comments