Skip to content

Instantly share code, notes, and snippets.

@schneiderfelipe
Forked from myano/cs.py
Last active December 4, 2017 20:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schneiderfelipe/9c236d4289aec2ef4797 to your computer and use it in GitHub Desktop.
Save schneiderfelipe/9c236d4289aec2ef4797 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import curses
import curses.textpad
def main_exec(stdscr):
begin_x = 20
begin_y = 7
height = 5
width = 40
win = curses.newwin(height, width, begin_y, begin_x)
tb = curses.textpad.Textbox(win)
text = tb.edit()
curses.addstr(4, 1, text.encode('utf_8'))
# hw = "Hello world!"
# while 1:
# c = stdscr.getch()
# if c == ord('p'):
# elif c == ord('q'): break # Exit the while()
# elif c == curses.KEY_HOME: x = y = 0
curses.endwin()
curses.wrapper(main_exec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment