def test_1(): stdscr = curses.initscr() #curses.noecho() #curses.echo() 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'): break # Exit the while() elif c == ord('q'): break # Exit the while() elif c == curses.KEY_HOME: x = y = 0 curses.endwin()
def a_textbox(): 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'))
def main(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')) time.sleep(10)
def colors(stdscr): colors = {getattr(curses, name): name for name in dir(curses) if name.startswith("COLOR_")} if not curses.can_change_color(): curses.addstr("Sorry, your terminal doesn't support color awesomeness") stdscr.refresh() get_q() return stdscr.refresh()
def google(): begin_x = 20 begin_y = 7 height = 5 width = 40 curses.noecho() curses.cbreak() win = curses.newwin(height, width, begin_y, begin_x) try: tb = curses.textpad.Textbox(win) text = tb.edit() curses.addstr(4,1,text.encode('utf_8')) finally: curses.endwin()
#!/usr/bin/env python2 import curses import curses.textpad import time stdscr = curses.initscr() #curses.noecho() #curses.echo() 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()
#!/usr/bin/env python2 import curses import curses.textpad import time stdscr = curses.initscr() #curses.noecho() #curses.echo() 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()
import curses.textpad import time stdscr = curses.initscr() curses.noecho() #curses.echo() 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(0, 0, text) # hw = "Hello world!" # while 1: # c = stdscr.getch() # if c == ord('p'): # pass # elif c == ord('q'): # break # Exit the while() # elif c == curses.KEY_HOME: # x = y = 0 curses.endwin()
def local_print(string): if curses: curses.addstr(string) else: print(string, end='')