Home:ALL Converter>(n)curses pad in python not working

(n)curses pad in python not working

Ask Time:2012-09-16T06:28:03         Author:byteit101

Json Formatter

I cannot seem to get ncurses pads to work in python (2.6, 2.7, and 3.2). Using code directly off of http://docs.python.org/howto/curses.html I even cannot get it to work. Non-pad code works perfectly.

import curses

def func(scr):
    pad = curses.newpad(100, 100)
    pad.addstr(0,0, "Testing")

    #  Displays a section of the pad in the middle of the screen
    pad.refresh( 0,0, 5,5, 10,10)

    scr.refresh()
    scr.getch()

if __name__ == '__main__':
    curses.wrapper(func)

What can the issue be? Removing the pad (and changing pad to scr) works fine

Author:byteit101,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12442965/ncurses-pad-in-python-not-working
yy