Skip to content

Instantly share code, notes, and snippets.

@hungneox
Created October 20, 2017 11:44
Show Gist options
  • Save hungneox/30aae951f14564c18bc0e7db01786947 to your computer and use it in GitHub Desktop.
Save hungneox/30aae951f14564c18bc0e7db01786947 to your computer and use it in GitHub Desktop.
Python curses
#!/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