7

我似乎无法让 ncurses 垫在 python(2.6、2.7 和 3.2)中工作。直接从http://docs.python.org/howto/curses.html使用代码我什至无法让它工作。非填充代码完美运行。

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)

问题可能是什么?卸下焊盘(并将焊盘更改为 scr)工作正常

4

1 回答 1

8

你正在覆盖垫。尝试getchpad对象而不是主窗口对象调用方法scr并删除scr.refresh.

于 2012-09-15T23:20:02.740 回答