Created
October 20, 2017 11:44
-
-
Save hungneox/30aae951f14564c18bc0e7db01786947 to your computer and use it in GitHub Desktop.
Python curses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import curses | |
import curses.textpad as textpad | |
try: | |
mainwindow = curses.initscr() | |
# Some curses-friendly terminal settings | |
curses.cbreak(); mainwindow.keypad(1); curses.noecho() | |
textpad.Textbox(mainwindow).edit() | |
finally: | |
# Reverse curses-friendly terminal settings | |
curses.nocbreak(); mainwindow.keypad(0); curses.echo() | |
curses.endwin() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment