Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Curses test script, by K. Novak
- import curses
- stdscr = curses.initscr()
- stdscr.keypad(1)
- #find terminal height and width
- mheight,mwidth = stdscr.getmaxyx()
- oWin = curses.newwin(mheight-1,mwidth,0,0)
- iWin = curses.newwin(1,mwidth,mheight-1,0)
- oWin.scrollok(1)
- iWin.scrollok(1)
- #function for refreshing the windows
- def ref_oWin(xc, yc):
- oWin.refresh()
- def ref_iWin(xc,yc):
- iWin.addstr(">")
- iWin.refresh()
- q = 1
- while q == 1:
- ref_oWin(0,0)
- ref_iWin(0,0)
- event = iWin.getstr(0,1)
- if event == "/quit":
- q = 2
- break
- else:
- oWin.addstr(event + "\n")
- curses.endwin()
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement